summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2023-02-19 20:16:04 +0000
committerJeremy Evans <code@jeremyevans.net>2023-02-19 14:26:34 -0800
commit3b239d2480123046a59a75f1089ab58d192b9c57 (patch)
treea7015491da2508153db26251ad30ac39d6d8a6a8 /hash.c
parent3d53827130e9f3792e80e9a947d5a0d604aa836b (diff)
downloadruby-3b239d2480123046a59a75f1089ab58d192b9c57.tar.gz
Remove (newly unneeded) remarks about aliases
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/hash.c b/hash.c
index 73070f0f06..9c57a96812 100644
--- a/hash.c
+++ b/hash.c
@@ -2745,8 +2745,6 @@ keep_if_i(VALUE key, VALUE value, VALUE hash)
* hash.select {|key, value| ... } -> new_hash
* hash.select -> new_enumerator
*
- * Hash#filter is an alias for Hash#select.
- *
* Returns a new \Hash object whose entries are those for which the block returns a truthy value:
* h = {foo: 0, bar: 1, baz: 2}
* h.select {|key, value| value < 2 } # => {:foo=>0, :bar=>1}
@@ -2775,8 +2773,6 @@ rb_hash_select(VALUE hash)
* hash.select! {|key, value| ... } -> self or nil
* hash.select! -> new_enumerator
*
- * Hash#filter! is an alias for Hash#select!.
- *
* Returns +self+, whose entries are those for which the block returns a truthy value:
* h = {foo: 0, bar: 1, baz: 2}
* h.select! {|key, value| value < 2 } => {:foo=>0, :bar=>1}
@@ -2897,8 +2893,6 @@ NOINSERT_UPDATE_CALLBACK(hash_aset_str)
* hash[key] = value -> value
* hash.store(key, value)
*
- * Hash#store is an alias for Hash#[]=.
-
* Associates the given +value+ with the given +key+; returns +value+.
*
* If the given +key+ exists, replaces its value with the given +value+;
@@ -2985,9 +2979,9 @@ rb_hash_replace(VALUE hash, VALUE hash2)
* hash.size -> integer
*
* Returns the count of entries in +self+:
+ *
* {foo: 0, bar: 1, baz: 2}.length # => 3
*
- * Hash#length is an alias for Hash#size.
*/
VALUE
@@ -3118,8 +3112,6 @@ each_pair_i_fast(VALUE key, VALUE value, VALUE _)
* hash.each -> new_enumerator
* hash.each_pair -> new_enumerator
*
- * Hash#each is an alias for Hash#each_pair.
-
* Calls the given block with each key-value pair; returns +self+:
* h = {foo: 0, bar: 1, baz: 2}
* h.each_pair {|key, value| puts "#{key}: #{value}"} # => {:foo=>0, :bar=>1, :baz=>2}
@@ -3451,10 +3443,10 @@ inspect_hash(VALUE hash, VALUE dummy, int recur)
* hash.inspect -> new_string
*
* Returns a new \String containing the hash entries:
+
* h = {foo: 0, bar: 1, baz: 2}
* h.inspect # => "{:foo=>0, :bar=>1, :baz=>2}"
*
- * Hash#to_s is an alias for Hash#inspect.
*/
static VALUE
@@ -3641,8 +3633,6 @@ rb_hash_values(VALUE hash)
* hash.has_key?(key) -> true or false
* hash.key?(key) -> true or false
* hash.member?(key) -> true or false
-
- * Methods #has_key?, #key?, and #member? are aliases for \#include?.
*
* Returns +true+ if +key+ is a key in +self+, otherwise +false+.
*/
@@ -3670,8 +3660,6 @@ rb_hash_search_value(VALUE key, VALUE value, VALUE arg)
* hash.has_value?(value) -> true or false
* hash.value?(value) -> true or false
*
- * Method #value? is an alias for \#has_value?.
- *
* Returns +true+ if +value+ is a value in +self+, otherwise +false+.
*/
@@ -3934,8 +3922,6 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
*
* Each argument in +other_hashes+ must be a \Hash.
*
- * \Method #update is an alias for \#merge!.
- *
* With arguments and no block:
* * Returns +self+, after the given hashes are merged into it.
* * The given hashes are merged left to right.
@@ -5335,8 +5321,6 @@ ruby_unsetenv(const char *name)
* ENV[name] = value -> value
* ENV.store(name, value) -> value
*
- * ENV.store is an alias for ENV.[]=.
- *
* Creates, updates, or deletes the named environment variable, returning the value.
* Both +name+ and +value+ may be instances of String.
* See {Valid Names and Values}[rdoc-ref:ENV@Valid+Names+and+Values].
@@ -5738,8 +5722,6 @@ env_values_at(int argc, VALUE *argv, VALUE _)
* ENV.filter { |name, value| block } -> hash of name/value pairs
* ENV.filter -> an_enumerator
*
- * ENV.filter is an alias for ENV.select.
- *
* Yields each environment variable name and its value as a 2-element Array,
* returning a Hash of the names and values for which the block returns a truthy value:
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
@@ -5783,8 +5765,6 @@ env_select(VALUE ehash)
* ENV.filter! { |name, value| block } -> ENV or nil
* ENV.filter! -> an_enumerator
*
- * ENV.filter! is an alias for ENV.select!.
- *
* Yields each environment variable name and its value as a 2-element Array,
* deleting each entry for which the block returns +false+ or +nil+,
* and returning ENV if any deletions made, or +nil+ otherwise:
@@ -6095,8 +6075,6 @@ env_empty_p(VALUE _)
* ENV.member?(name) -> true or false
* ENV.key?(name) -> true or false
*
- * ENV.has_key?, ENV.member?, and ENV.key? are aliases for ENV.include?.
- *
* Returns +true+ if there is an environment variable with the given +name+:
* ENV.replace('foo' => '0', 'bar' => '1')
* ENV.include?('foo') # => true
@@ -6577,8 +6555,6 @@ env_update_block_i(VALUE key, VALUE val, VALUE _)
* ENV.merge!(*hashes) -> ENV
* ENV.merge!(*hashes) { |name, env_val, hash_val| block } -> ENV
*
- * ENV.update is an alias for ENV.merge!.
- *
* Adds to ENV each key/value pair in the given +hash+; returns ENV:
* ENV.replace('foo' => '0', 'bar' => '1')
* ENV.merge!('baz' => '2', 'bat' => '3') # => {"bar"=>"1", "bat"=>"3", "baz"=>"2", "foo"=>"0"}