Navigation Menu

Skip to content

Commit

Permalink
Use string interpolation for version memoization rather than concaten…
Browse files Browse the repository at this point in the history
…ation, as it is faster
  • Loading branch information
cheald authored and nex3 committed Nov 22, 2011
1 parent 98ce447 commit 848be1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/haml/util.rb
Expand Up @@ -267,7 +267,7 @@ def version_gt(v1, v2)
# @return [Boolean]
def version_geq(v1, v2)
@@version_comparison_cache ||= {}
k = v1 + v2
k = "#{v1}#{v2}"
return @@version_comparison_cache[k] unless @@version_comparison_cache[k].nil?
@@version_comparison_cache[k] = ( version_gt(v1, v2) || !version_gt(v2, v1) )
end
Expand Down

0 comments on commit 848be1b

Please sign in to comment.