Removed XML::Lexer#buffering?
Instead of wrapping a predicate method around the ivar we'll just access it directly. This reduces average lexing times in the big XML benchmark from 7,5 to ~7 seconds.
This commit is contained in:
1 parent
b854f737cd
commit
9dfdefee47
1 file changed
+1
-10
+1
-10
@@ -215,15 +215,6 @@ module Oga
|
||||
@buffer_start_position = position
|
||||
end
|
||||
|
||||
##
|
||||
# Returns `true` if we're currently buffering.
|
||||
#
|
||||
# @return [TrueClass|FalseClass]
|
||||
#
|
||||
def buffering?
|
||||
return !!@buffer_start_position
|
||||
end
|
||||
|
||||
##
|
||||
# Emits the current buffer if we have any. The current line number is
|
||||
# advanced based on the amount of newlines in the buffer.
|
||||
@@ -538,7 +529,7 @@ module Oga
|
||||
# will otherwise take precedence over the other rules.
|
||||
any => {
|
||||
# First character, start buffering (unless we already are buffering).
|
||||
start_buffer(ts) unless buffering?
|
||||
start_buffer(ts) unless @buffer_start_position
|
||||
|
||||
# EOF, emit the text buffer.
|
||||
if te == eof
|
||||
|
||||
Reference in new issue
Block a user