File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ def is_multiline_non_rst_block(line):
159159 return False
160160
161161
162- _NON_RST_BLOCKS_CACHE = {}
163162_ZERO_OR_MORE_SPACES_RE = re .compile (" *" )
164163
165164
@@ -168,14 +167,7 @@ def hide_non_rst_blocks(lines, hidden_block_cb=None):
168167
169168 The filter actually replace "removed" lines by empty lines, so the
170169 line numbering still make sense.
171-
172- This function is quite hot, so we cache the returned value where possible.
173- The function is only "pure" when hidden_block_cb is None, however,
174- so we can only safely cache the output when hidden_block_cb=None.
175170 """
176- lines = tuple (lines )
177- if hidden_block_cb is None and lines in _NON_RST_BLOCKS_CACHE :
178- return _NON_RST_BLOCKS_CACHE [lines ]
179171 in_literal = None
180172 excluded_lines = []
181173 block_line_start = None
@@ -203,10 +195,7 @@ def hide_non_rst_blocks(lines, hidden_block_cb=None):
203195 output .append (line )
204196 if excluded_lines and hidden_block_cb :
205197 hidden_block_cb (block_line_start , "" .join (excluded_lines ))
206- output = tuple (output )
207- if hidden_block_cb is None :
208- _NON_RST_BLOCKS_CACHE [lines ] = output
209- return output
198+ return tuple (output )
210199
211200
212201_starts_with_directive_marker = re .compile (rf"\.\. { rst .ALL_DIRECTIVES } ::" ).match
You can’t perform that action at this time.
0 commit comments