Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/re/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def _optimize_charset(charset, iscased=None, fixup=None, fixes=None):
# less significant byte is a bit index in the chunk (just like the
# CHARSET matching).

charmap = bytes(charmap) # should be hashable
charmap = charmap.take_bytes() # should be hashable
comps = {}
mapping = bytearray(256)
block = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove data copy from :mod:`re` compilation of regexes with large charsets
by using :meth:`bytearray.take_bytes`.
Loading