mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
more micro optimization
This commit is contained in:
@@ -75,7 +75,6 @@ module Liquid
|
||||
end
|
||||
|
||||
@ss.pos -= 2
|
||||
|
||||
@ss.string.byteslice(start, @ss.pos - start)
|
||||
end
|
||||
|
||||
@@ -85,16 +84,21 @@ module Liquid
|
||||
found_variable_end = false
|
||||
|
||||
# it is possible to see a {% before a }} so we need to check for that
|
||||
byte_a = @ss.peek_byte
|
||||
@ss.pos += 1
|
||||
|
||||
until @ss.eos?
|
||||
case @ss.peek(2)
|
||||
when "}}"
|
||||
@ss.pos += 2
|
||||
byte_b = @ss.peek_byte
|
||||
|
||||
if byte_a == CLOSE_CURLEY && byte_b == CLOSE_CURLEY
|
||||
@ss.pos += 1
|
||||
found_variable_end = true
|
||||
break
|
||||
when "{%"
|
||||
elsif byte_a == OPEN_CURLEY && byte_b == PERCENTAGE
|
||||
return next_tag_token(start)
|
||||
end
|
||||
|
||||
byte_a = byte_b
|
||||
@ss.pos += 1
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user