Method: List#hash

Defined in:
ext/list/list.c

#hashObject



666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'ext/list/list.c', line 666

static VALUE
list_hash(VALUE self)
{
  item_t *c;
  st_index_t h;
  VALUE n;

  h = rb_hash_start(LIST_LEN(self));
  h = rb_hash_uint(h, (st_index_t)list_hash);
  LIST_FOR(self, c) {
    n = rb_hash(c->value);
    h = rb_hash_uint(h, NUM2LONG(n));
  }
  h = rb_hash_end(h);
  return LONG2FIX(h);
}