summaryrefslogtreecommitdiff
path: root/test/ruby/test_thread_queue.rb
diff options
context:
space:
mode:
authorAlexander Momchilov <alexandermomchilov@gmail.com>2023-12-18 03:17:44 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-12-18 14:51:16 -0500
commitb5c6c0122f5b010cb5f43e7a236c4ba2b1d56a2a (patch)
treee8b9a2ae9202b92d03ba39336e9678b07be3e68e /test/ruby/test_thread_queue.rb
parent893fe30ef2b30525d932d6b1256f717cc60b3311 (diff)
compare_by_identity: remove alloc for empty Hash
For non-empty Hashes, this function needs to rehash all the stored values (using the new `compare` and `hash` functions from `identhash`). It does so by writing into a newly allocated `tmp` Hash, and then transferring ownership of its st table into `self`. For empty Hashes, we can skip allocating this `tmp`, because there's nothing to re-hash. We can just modify our new st table's `type` in-place.
Diffstat (limited to 'test/ruby/test_thread_queue.rb')
0 files changed, 0 insertions, 0 deletions