mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Favor unless over if for negative conditions
This commit is contained in:
@@ -300,7 +300,7 @@ module Liquid
|
|||||||
def replace_last(input, string, replacement)
|
def replace_last(input, string, replacement)
|
||||||
start_index = input.to_s.rindex(string.to_s)
|
start_index = input.to_s.rindex(string.to_s)
|
||||||
|
|
||||||
if !start_index.nil?
|
unless start_index.nil?
|
||||||
end_index = start_index + replacement.to_s.length
|
end_index = start_index + replacement.to_s.length
|
||||||
|
|
||||||
duplicate = input.to_s.dup
|
duplicate = input.to_s.dup
|
||||||
|
|||||||
Reference in New Issue
Block a user