Use early returns rather than large if in Variable#taint_check

This commit is contained in:
Dylan Thacker-Smith
2015-07-07 15:56:03 -04:00
parent 80b6ac3bc7
commit c4c398174b
+3 -2
View File
@@ -107,7 +107,9 @@ module Liquid
end end
def taint_check(context, obj) def taint_check(context, obj)
if obj.tainted? && Template.taint_mode != :lax return unless obj.tainted?
return if Template.taint_mode == :lax
@markup =~ QuotedFragment @markup =~ QuotedFragment
name = Regexp.last_match(0) name = Regexp.last_match(0)
@@ -123,5 +125,4 @@ module Liquid
end end
end end
end end
end
end end