Files
mruby-mruby/src
KOBAYASHI Shuji 0c88c71786 Use type tag for hash code in ht_hash_func()
The function corresponding to `ht_hash_func()` was as follows in the days of
khash implementation (before d78acc7a).

  ```c
  mrb_hash_ht_hash_func(mrb_state *mrb, mrb_value key)
  {
    enum mrb_vtype t = mrb_type(key);
    ...
    switch (t) {
    ...
    default:
      hv = mrb_funcall(mrb, key, "hash", 0);
      h = (khint_t)t ^ (khint_t)mrb_fixnum(hv);
      break;
    }
    ...
  }
  ```

When switched to the segmented list implementation (d78acc7a), this function
was changed as follows.

  ```c
  sg_hash_func(mrb_state *mrb, seglist *t, mrb_value key)
  {
    enum mrb_vtype tt = mrb_type(key);
    ...
    switch (tt) {
    ...
    default:
      hv = mrb_funcall(mrb, key, "hash", 0);
      h = (size_t)t ^ (size_t)mrb_fixnum(hv);
      break;
    }
    ...
  }
  ```

Since the argument `t` was added, the variable for type tag was changed from
`t` to `tt`, but the variable used in the expression of `h` remained `t`.

Probably this is an omission of change, so fixed it.
2020-07-25 16:59:02 +09:00
..
2020-07-19 07:47:07 +09:00
2020-05-07 08:38:46 +09:00
2020-06-05 14:40:07 +09:00
2020-05-09 22:30:05 +09:00
2019-09-16 11:58:35 +09:00
2020-06-05 17:52:22 +09:00
2020-07-22 15:01:54 +09:00
2020-07-19 07:47:07 +09:00
2020-06-05 17:26:40 +09:00
2020-06-05 14:40:07 +09:00
2016-05-09 17:19:47 +02:00