We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63653bf commit aa3d954Copy full SHA for aa3d954
lib/rexml/source.rb
@@ -77,6 +77,7 @@ def initialize(arg, encoding=nil)
77
detect_encoding
78
end
79
@line = 0
80
+ @term_encord = {}
81
82
83
# The current buffer (what we're going to read next)
@@ -227,7 +228,7 @@ def read(term = nil, min_bytes = 1)
227
228
229
def read_until(term)
230
pattern = Private::PRE_DEFINED_TERM_PATTERNS[term] || /#{Regexp.escape(term)}/
- term = encode(term)
231
+ term = @term_encord[term] ||= encode(term)
232
until str = @scanner.scan_until(pattern)
233
break if @source.nil?
234
break if @source.eof?
0 commit comments