You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
##### `Hash#[]` vs `Hash.fetch`[code](code/hash/bracket-vs-fetch.rb)
414
+
##### `Hash#[]` vs `Hash#fetch`[code](code/hash/bracket-vs-fetch.rb)
415
415
416
416
If you use Ruby 2.2, `Symbol` could be more performant than `String` as `Hash` keys.
417
417
Read more regarding this: [Symbol GC in Ruby 2.2](http://www.sitepoint.com/symbol-gc-ruby-2-2/) and [Unraveling String Key Performance in Ruby 2.2](http://www.sitepoint.com/unraveling-string-key-performance-ruby-2-2/).
@@ -438,7 +438,7 @@ Comparison:
438
438
Hash#fetch, string: 3981166.5 i/s - 1.89x slower
439
439
```
440
440
441
-
##### `Hash#[]` vs `Hash#dup`[code](code/hash/bracket-vs-dup.rb)
441
+
##### `Hash[]` vs `Hash#dup`[code](code/hash/bracket-vs-dup.rb)
0 commit comments