[前][次][番号順一覧][スレッド一覧]

ruby-changes:66578

From: Ketan <ko1@a...>
Date: Wed, 23 Jun 2021 23:42:22 +0900 (JST)
Subject: [ruby-changes:66578] 2fb435b3ab (master): Add Related link from String#hash to Object#hash

https://git.ruby-lang.org/ruby.git/commit/?id=2fb435b3ab

From 2fb435b3ab19bab644083c6eaf7ff06ce5b01841 Mon Sep 17 00:00:00 2001
From: Ketan Bhatt <ketanbhatt1006@g...>
Date: Thu, 13 May 2021 10:28:51 +0100
Subject: Add Related link from String#hash to Object#hash

We came across a bug in our code because we assumed `String#hash` to be consistent across Ruby processes, which was incorrect.

Our search lead us to `Object#hash` which has the right warning that `String#hash` doesn't. We also noticed that a previous version of the documentation for `String#hash` pointed to `Object#hash` that was removed by https://github.com/ruby/ruby/pull/3565.
We think this removal might not be intended and just got missed amidst other changes.
---
 string.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/string.c b/string.c
index 94f6a81..0bb015f 100644
--- a/string.c
+++ b/string.c
@@ -3311,6 +3311,8 @@ rb_str_hash_cmp(VALUE str1, VALUE str2) https://github.com/ruby/ruby/blob/trunk/string.c#L3311
  *
  * Returns the integer hash value for +self+.
  * The value is based on the length, content and encoding of +self+.
+ *
+ * Related: Object#hash
  */
 
 static VALUE
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]