improve const performance

This commit is contained in:
yanyongyu 2022-01-01 16:43:48 +08:00
parent 2bb365c70e
commit 338c41abd5

View File

@ -1,20 +1,22 @@
from sys import intern
# used by Matcher # used by Matcher
RECEIVE_KEY = "_receive_{id}" RECEIVE_KEY = intern("_receive_{id}")
LAST_RECEIVE_KEY = "_last_receive" LAST_RECEIVE_KEY = intern("_last_receive")
ARG_KEY = "{key}" ARG_KEY = intern("{key}")
REJECT_TARGET = "_current_target" REJECT_TARGET = intern("_current_target")
REJECT_CACHE_TARGET = "_next_target" REJECT_CACHE_TARGET = intern("_next_target")
# used by Rule # used by Rule
PREFIX_KEY = "_prefix" PREFIX_KEY = intern("_prefix")
CMD_KEY = "command" CMD_KEY = intern("command")
RAW_CMD_KEY = "raw_command" RAW_CMD_KEY = intern("raw_command")
CMD_ARG_KEY = "command_arg" CMD_ARG_KEY = intern("command_arg")
SHELL_ARGS = "_args" SHELL_ARGS = intern("_args")
SHELL_ARGV = "_argv" SHELL_ARGV = intern("_argv")
REGEX_MATCHED = "_matched" REGEX_MATCHED = intern("_matched")
REGEX_GROUP = "_matched_groups" REGEX_GROUP = intern("_matched_groups")
REGEX_DICT = "_matched_dict" REGEX_DICT = intern("_matched_dict")