Project

General

Profile

Actions

Feature #14258

closed

[PATCH] hash literal deduplicates like Hash#[]=

Added by normalperson (Eric Wong) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:84554]

Description

We should reuse the same hash key deduplication logic
as Hash#[]= when creating hash literals using the newhash
VM instruction.

* hash.c (rb_hash_key_str): new function
  (hash_aset_str): use rb_hash_key_str
* internal.h: add rb_hash_key_str
* st.c (st_stringify): use rb_hash_key_str
* test/ruby/test_hash.rb (test_NEWHASH_fstring_key): dynamic key

Files

Actions #1

Updated by Anonymous about 6 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r61514.


hash literal deduplicates like Hash#[]=

From: Eric Wong

  • hash.c (rb_hash_key_str): new function
    (hash_aset_str): use rb_hash_key_str
  • internal.h: add rb_hash_key_str
  • st.c (st_stringify): use rb_hash_key_str
  • test/ruby/test_hash.rb (test_NEWHASH_fstring_key): dynamic key
    [ruby-core:84554] [Feature #14258]
Actions

Also available in: Atom PDF

Like0
Like0