Skip to content

Commit

Permalink
py_driver : optimised Antlr4ResultHandler to improve time (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
Munmud authored and jrgemignani committed Dec 13, 2023
1 parent def28f9 commit c5be119
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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,9 @@ 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 c5be119

Please sign in to comment.