From 75775157ea68efdd0b71345a37a6930e5bf1d2ef Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 7 Nov 2016 00:45:00 +0000 Subject: Introduce table improvement by Vladimir Makarov . [Feature #12142] See header of st.c for improvment details. You can see all of code history here: This improvement is discussed at 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 --- ext/-test-/st/foreach/foreach.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/-test-/st/foreach') diff --git a/ext/-test-/st/foreach/foreach.c b/ext/-test-/st/foreach/foreach.c index 1e0fd515c9..209b535503 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); -- cgit v1.2.3