summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrii Dmytrenko <refresh.xss@gmail.com>2017-12-19 20:37:09 +0000
committerMichael Herold <github@michaeljherold.com>2017-12-19 14:37:09 -0600
commitdabdcd17e7d482cbc7f153ddc20149353d02a56d (patch)
tree9e4c37d6692a43dcb7973846f8d8a803c55ab1d6 /lib
parent32514df06550e21dc47d5c989ff6a90ef0c9b9fa (diff)
downloadhashie-dabdcd17e7d482cbc7f153ddc20149353d02a56d.tar.gz
Fix Hashie::Rash randomly losing keys (#430)
Diffstat (limited to 'lib')
-rw-r--r--lib/hashie/rash.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashie/rash.rb b/lib/hashie/rash.rb
index 1e059f3..0024eee 100644
--- a/lib/hashie/rash.rb
+++ b/lib/hashie/rash.rb
@@ -136,7 +136,7 @@ module Hashie
def optimize_if_necessary!
return unless (@lookups += 1) >= @optimize_every
- @regexes = @regex_counts.sort_by { |_, count| -count }.map { |regex, _| regex }
+ @regexes = @regexes.sort_by { |regex| -@regex_counts[regex] }
@lookups = 0
end
end