Skip to content

Commit

Permalink
chore: remove unused _shadow_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
5j9 committed Apr 18, 2024
1 parent ded06ae commit 4b235f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions wikitextparser/_parser_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ def arguments(self) -> List[Argument]:
else:
arg_span = old_span
arg = Argument(lststr, type_to_spans, arg_span, type_, self)
arg._shadow_cache = (
lststr[0][s:e],
shadow[arg_self_start:arg_self_end],
)
arg._span_data[3] = shadow[arg_self_start:arg_self_end]
arguments_append(arg)
return arguments

Expand Down
4 changes: 1 addition & 3 deletions wikitextparser/_wikitext.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class WikiText:
# The following class attribute acts as a default value.
_type = 'WikiText'

__slots__ = '_type_to_spans', '_lststr', '_span_data', '_shadow_cache'
__slots__ = '_type_to_spans', '_lststr', '_span_data'

def __init__(
self,
Expand Down Expand Up @@ -232,7 +232,6 @@ def __init__(
if _type not in SPAN_PARSER_TYPES:
type_to_spans = self._type_to_spans = parse_to_spans(byte_array)
type_to_spans[_type] = [span]
self._shadow_cache = string, byte_array
else:
# In SPAN_PARSER_TYPES, we can't pass the original byte_array to
# parser to generate the shadow because it will replace the whole
Expand All @@ -250,7 +249,6 @@ def __init__(
byte_array[0] = 3
byte_array[-1] = 32
type_to_spans = parse_to_spans(byte_array)
self._shadow_cache = string, byte_array
type_to_spans[_type].insert(0, span)
self._type_to_spans = type_to_spans
if type(self) is Parameter:
Expand Down

0 comments on commit 4b235f3

Please sign in to comment.