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

ruby-changes:44889

From: rhe <ko1@a...>
Date: Fri, 2 Dec 2016 11:24:50 +0900 (JST)
Subject: [ruby-changes:44889] rhe:r56962 (trunk): re.c: count associated Regexp object in MatchData#hash

rhe	2016-12-02 11:24:45 +0900 (Fri, 02 Dec 2016)

  New Revision: 56962

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56962

  Log:
    re.c: count associated Regexp object in MatchData#hash
    
    Don't discard the hash value computed for the regexp object. It seems it
    was simply missed out in r24754, when MatchData#hash was initially
    implemented.

  Modified files:
    trunk/re.c
Index: re.c
===================================================================
--- re.c	(revision 56961)
+++ re.c	(revision 56962)
@@ -2950,7 +2950,7 @@ match_hash(VALUE match) https://github.com/ruby/ruby/blob/trunk/re.c#L2950
     const struct re_registers *regs;
     st_index_t hashval = rb_hash_start(rb_str_hash(RMATCH(match)->str));
 
-    rb_hash_uint(hashval, reg_hash(RMATCH(match)->regexp));
+    hashval = rb_hash_uint(hashval, reg_hash(RMATCH(match)->regexp));
     regs = RMATCH_REGS(match);
     hashval = rb_hash_uint(hashval, regs->num_regs);
     hashval = rb_hash_uint(hashval, rb_memhash(regs->beg, regs->num_regs * sizeof(*regs->beg)));

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

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