From e3c2fd47b2fe151ad58e9a441974510292c24faa Mon Sep 17 00:00:00 2001 From: Michael Go Date: Thu, 24 Oct 2024 22:24:58 -0300 Subject: [PATCH] more micro optimization --- lib/liquid/tokenizer.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/liquid/tokenizer.rb b/lib/liquid/tokenizer.rb index 54d71a2c..82b1912f 100644 --- a/lib/liquid/tokenizer.rb +++ b/lib/liquid/tokenizer.rb @@ -96,15 +96,18 @@ module Liquid byte_b = @ss.peek_byte + if byte_b != CLOSE_CURLEY && byte_b != PERCENTAGE + @ss.pos += 1 + byte_a = byte_b + next + end + if byte_a == CLOSE_CURLEY && byte_b == CLOSE_CURLEY @ss.pos += 1 return @ss.string.byteslice(start, @ss.pos - start) elsif byte_a == OPEN_CURLEY && byte_b == PERCENTAGE return next_tag_token(start) end - - byte_a = byte_b - @ss.pos += 1 end return "{{"