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:
Yorick Peterse 2014-05-01 22:59:56 +02:00
parent b854f737cd
commit 9dfdefee47
1 changed files with 1 additions and 10 deletions

View File

@ -215,15 +215,6 @@ module Oga
@buffer_start_position = position @buffer_start_position = position
end 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 # Emits the current buffer if we have any. The current line number is
# advanced based on the amount of newlines in the buffer. # advanced based on the amount of newlines in the buffer.
@ -538,7 +529,7 @@ module Oga
# will otherwise take precedence over the other rules. # will otherwise take precedence over the other rules.
any => { any => {
# First character, start buffering (unless we already are buffering). # 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. # EOF, emit the text buffer.
if te == eof if te == eof