diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-09-26 10:27:11 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-09-26 10:27:11 -0400 |
commit | a6da7938017647dd6e19e23d3d47126cb7a3e1fe (patch) | |
tree | e46c6fd36d800143321b486565ebba79a3bb1f5a /railties/lib/rails/commands/generate.rb | |
parent | 15a8740d68ccf1f376b5f2cf29c5336d8716278f (diff) | |
download | rails-a6da7938017647dd6e19e23d3d47126cb7a3e1fe.tar.gz rails-a6da7938017647dd6e19e23d3d47126cb7a3e1fe.tar.bz2 rails-a6da7938017647dd6e19e23d3d47126cb7a3e1fe.zip |
Use xor to avoid allocations in `AR::Core#hash`
This is not as good a solution as actually hashing both values, but Ruby
doesn't expose that capability other than allocating the array. Unless we were
to do something silly like have a thread local array that is re-used, I don't
see any other way to do this without allocation. This solution may not be
perfect, but it should reasonably avoid collisions to the extent that we need.
Diffstat (limited to 'railties/lib/rails/commands/generate.rb')
0 files changed, 0 insertions, 0 deletions