summaryrefslogtreecommitdiff
path: root/ext/-test-
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-07 00:45:00 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-07 00:45:00 (GMT)
commit75775157ea68efdd0b71345a37a6930e5bf1d2ef (patch)
tree311920522c27ab515ddfda5d1f45d1d3f68f142a /ext/-test-
parent2bb96b87a752ba186bd285e43239119c6c2f2678 (diff)
Introduce table improvement by Vladimir Makarov <vmakarov@redhat.com>.
[Feature #12142] See header of st.c for improvment details. You can see all of code history here: <https://github.com/vnmakarov/ruby/tree/hash_tables_with_open_addressing> This improvement is discussed at <https://bugs.ruby-lang.org/issues/12142> with many people, especially with Yura Sokolov. * st.c: improve st_table. * include/ruby/st.h: ditto. * internal.h, numeric.c, hash.c (rb_dbl_long_hash): extract a function. * ext/-test-/st/foreach/foreach.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-')
-rw-r--r--ext/-test-/st/foreach/foreach.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/-test-/st/foreach/foreach.c b/ext/-test-/st/foreach/foreach.c
index 1e0fd51..209b535 100644
--- a/ext/-test-/st/foreach/foreach.c
+++ b/ext/-test-/st/foreach/foreach.c
@@ -14,13 +14,13 @@ force_unpack_check(struct checker *c, st_data_t key, st_data_t val)
if (c->nr == 0) {
st_data_t i;
- if (!c->tbl->entries_packed) rb_bug("should be packed\n");
+ if (c->tbl->bins != NULL) rb_bug("should be packed\n");
/* force unpacking during iteration: */
for (i = 1; i < expect_size; i++)
st_add_direct(c->tbl, i, i);
- if (c->tbl->entries_packed) rb_bug("should be unpacked\n");
+ if (c->tbl->bins == NULL) rb_bug("should be unpacked\n");
}
if (key != c->nr) {
@@ -84,7 +84,7 @@ unp_fec(VALUE self, VALUE test)
st_add_direct(tbl, 0, 0);
- if (!tbl->entries_packed) rb_bug("should still be packed\n");
+ if (tbl->bins != NULL) rb_bug("should still be packed\n");
st_foreach_check(tbl, unp_fec_i, (st_data_t)&c, -1);
@@ -98,7 +98,7 @@ unp_fec(VALUE self, VALUE test)
(VALUE)c.nr, (VALUE)expect_size);
}
- if (tbl->entries_packed) rb_bug("should be unpacked\n");
+ if (tbl->bins == NULL) rb_bug("should be unpacked\n");
st_free_table(tbl);
@@ -145,7 +145,7 @@ unp_fe(VALUE self, VALUE test)
st_add_direct(tbl, 0, 0);
- if (!tbl->entries_packed) rb_bug("should still be packed\n");
+ if (tbl->bins != NULL) rb_bug("should still be packed\n");
st_foreach(tbl, unp_fe_i, (st_data_t)&c);
@@ -159,7 +159,7 @@ unp_fe(VALUE self, VALUE test)
(VALUE)c.nr, (VALUE)expect_size);
}
- if (tbl->entries_packed) rb_bug("should be unpacked\n");
+ if (tbl->bins == NULL) rb_bug("should be unpacked\n");
st_free_table(tbl);