Revert "Instrument usage of bug with iteration of String with offset or 0 limit (#1667)" (#1677)

This reverts commit c743936a78.
This commit is contained in:
Dylan Thacker-Smith
2023-02-22 12:48:18 -05:00
committed by GitHub
parent 9ab688eada
commit e650dc4195
2 changed files with 1 additions and 35 deletions
+1 -5
View File
@@ -16,11 +16,7 @@ module Liquid
# Maintains Ruby 1.8.7 String#each behaviour on 1.9
if collection.is_a?(String)
return [] if collection.empty?
if from > 0 || to == 0
Usage.increment("string_slice_bug")
end
return [collection]
return collection.empty? ? [] : [collection]
end
return [] unless collection.respond_to?(:each)