From 67d541f0b48bd459b2275991035df2b64519be77 Mon Sep 17 00:00:00 2001 From: Pieter Olivier Date: Sat, 7 Dec 2024 11:53:13 +0100 Subject: [PATCH] Removed redundant character creation caching --- .../parser/gtd/result/out/CharNodeFlattener.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/org/rascalmpl/parser/gtd/result/out/CharNodeFlattener.java b/src/org/rascalmpl/parser/gtd/result/out/CharNodeFlattener.java index 2da906a461a..97b6621b3a4 100644 --- a/src/org/rascalmpl/parser/gtd/result/out/CharNodeFlattener.java +++ b/src/org/rascalmpl/parser/gtd/result/out/CharNodeFlattener.java @@ -16,10 +16,7 @@ /** * A converter for character result nodes. */ -@SuppressWarnings("unchecked") public class CharNodeFlattener{ - private final T[] cache = (T[]) new Object[128]; - public CharNodeFlattener(){ super(); } @@ -28,17 +25,6 @@ public CharNodeFlattener(){ * Converts the given character result node to the UPTR format. */ public T convertToUPTR(INodeConstructorFactory nodeConstructorFactory, CharNode node){ - int charNumber = node.getCharacter(); - - // Cache 7-bit ASCII character results. - if(charNumber < 128){ - T result = cache[charNumber]; - if(result != null) return result; - - result = nodeConstructorFactory.createCharNode(charNumber); - cache[charNumber] = result; - } - - return nodeConstructorFactory.createCharNode(charNumber); + return nodeConstructorFactory.createCharNode(node.getCharacter()); } }