Skip to content

Commit

Permalink
chore(_inner_type_to_spans_copy): avoid deepcopy
Browse files Browse the repository at this point in the history
I have not tested it, but deepcopy tries to avoid circular
references and is probably slower.
  • Loading branch information
5j9 committed Apr 9, 2024
1 parent 0d8eef5 commit ec075fe
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions wikitextparser/_wikitext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from bisect import bisect_left, bisect_right, insort_right
from copy import deepcopy
from html import unescape
from itertools import compress, islice
from operator import attrgetter
Expand Down Expand Up @@ -621,8 +620,6 @@ def _inner_type_to_spans_copy(self) -> Dict[str, List[List[int]]]:
self.string.
"""
ss, se, _, _ = self._span_data
if ss == 0 and se == len(self._lststr[0]):
return deepcopy(self._type_to_spans)
return {
type_: [
[s - ss, e - ss, m, ba[:] if ba is not None else None]
Expand Down

0 comments on commit ec075fe

Please sign in to comment.