Skip to content

Commit

Permalink
Optimised Antlr4ResultHandler initialization (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
Munmud authored Aug 21, 2023
1 parent 84961c6 commit 439cf33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/python/age/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from antlr4.tree.Tree import *
from decimal import Decimal

resultHandler = None

class ResultHandler:
def parse(ageData):
pass
Expand All @@ -34,7 +36,10 @@ def parseAgeValue(value, cursor=None):
if value is None:
return None

resultHandler = Antlr4ResultHandler(None)
global resultHandler
if (resultHandler == None):
resultHandler = Antlr4ResultHandler(None)

try:
return resultHandler.parse(value)
except Exception as ex:
Expand Down

0 comments on commit 439cf33

Please sign in to comment.