File tree 2 files changed +13
-8
lines changed
2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
from collections import defaultdict
2
- from functools import lru_cache
3
2
from typing import Dict , List , Set , Tuple
4
3
4
+ from Utils import cache_argsless
5
+
5
6
from .item_definition_classes import (
6
7
CATEGORY_NAME_MAPPINGS ,
7
8
DoorItemDefinition ,
@@ -260,17 +261,17 @@ def get_parent_progressive_item(item_name: str) -> str:
260
261
return _progressive_lookup .get (item_name , item_name )
261
262
262
263
263
- @lru_cache
264
+ @cache_argsless
264
265
def get_vanilla () -> StaticWitnessLogicObj :
265
266
return StaticWitnessLogicObj (get_vanilla_logic ())
266
267
267
268
268
- @lru_cache
269
+ @cache_argsless
269
270
def get_sigma_normal () -> StaticWitnessLogicObj :
270
271
return StaticWitnessLogicObj (get_sigma_normal_logic ())
271
272
272
273
273
- @lru_cache
274
+ @cache_argsless
274
275
def get_sigma_expert () -> StaticWitnessLogicObj :
275
276
return StaticWitnessLogicObj (get_sigma_expert_logic ())
276
277
Original file line number Diff line number Diff line change 1
- from functools import lru_cache
2
1
from math import floor
3
2
from pkgutil import get_data
4
3
from random import random
@@ -103,10 +102,15 @@ def parse_lambda(lambda_string) -> WitnessRule:
103
102
return lambda_set
104
103
105
104
106
- @lru_cache (maxsize = None )
105
+ _adjustment_file_cache = dict ()
106
+
107
+
107
108
def get_adjustment_file (adjustment_file : str ) -> List [str ]:
108
- data = get_data (__name__ , adjustment_file ).decode ("utf-8" )
109
- return [line .strip () for line in data .split ("\n " )]
109
+ if adjustment_file not in _adjustment_file_cache :
110
+ data = get_data (__name__ , adjustment_file ).decode ("utf-8" )
111
+ _adjustment_file_cache [adjustment_file ] = [line .strip () for line in data .split ("\n " )]
112
+
113
+ return _adjustment_file_cache [adjustment_file ]
110
114
111
115
112
116
def get_disable_unrandomized_list () -> List [str ]:
You can’t perform that action at this time.
0 commit comments