summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-26 16:19:04 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-26 16:19:04 +0000
commitc4c821a7d7f2229a7c8d2c36cdc6b20668101081 (patch)
treefa38a537cd03cadb33f41b83f2912373bdad876f /array.c
parent9ae121d6df75c50bf114aaa3127715ad3194c047 (diff)
* hash.c (rb_hash_tbl_raw), internal.h: added.
Returns st_table without shading hash. * array.c: use rb_hash_tbl_raw() for read-only purpose. * compile.c (iseq_compile_each): ditto. * gc.c (count_objects): ditto. * insns.def: ditto. * process.c: ditto. * thread.c (clear_coverage): ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/array.c b/array.c
index f5f6d6f..bb5e4a9 100644
--- a/array.c
+++ b/array.c
@@ -3840,7 +3840,7 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
ary3 = rb_ary_new();
for (i=0; i<RARRAY_LEN(ary1); i++) {
- if (st_lookup(RHASH_TBL(hash), RARRAY_AREF(ary1, i), 0)) continue;
+ if (st_lookup(rb_hash_tbl_raw(hash), RARRAY_AREF(ary1, i), 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
}
ary_recycle_hash(hash);
@@ -3881,7 +3881,7 @@ rb_ary_and(VALUE ary1, VALUE ary2)
for (i=0; i<RARRAY_LEN(ary1); i++) {
vv = (st_data_t)(v = rb_ary_elt(ary1, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
@@ -3917,13 +3917,13 @@ rb_ary_or(VALUE ary1, VALUE ary2)
for (i=0; i<RARRAY_LEN(ary1); i++) {
vv = (st_data_t)(v = rb_ary_elt(ary1, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
for (i=0; i<RARRAY_LEN(ary2); i++) {
vv = (st_data_t)(v = rb_ary_elt(ary2, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
rb_ary_push(ary3, v);
}
}
@@ -3983,7 +3983,7 @@ rb_ary_uniq_bang(VALUE ary)
FL_SET_EMBED(ary);
}
ary_resize_capa(ary, i);
- st_foreach(RHASH_TBL(hash), push_value, ary);
+ st_foreach(rb_hash_tbl_raw(hash), push_value, ary);
}
else {
hash = ary_make_hash(ary);
@@ -3992,7 +3992,7 @@ rb_ary_uniq_bang(VALUE ary)
}
for (i=j=0; i<RARRAY_LEN(ary); i++) {
st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
rb_ary_store(ary, j++, v);
}
}
@@ -4033,14 +4033,14 @@ rb_ary_uniq(VALUE ary)
if (rb_block_given_p()) {
hash = ary_make_hash_by(ary);
uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
- st_foreach(RHASH_TBL(hash), push_value, uniq);
+ st_foreach(rb_hash_tbl_raw(hash), push_value, uniq);
}
else {
hash = ary_make_hash(ary);
uniq = ary_new(rb_obj_class(ary), RHASH_SIZE(hash));
for (i=0; i<RARRAY_LEN(ary); i++) {
st_data_t vv = (st_data_t)(v = rb_ary_elt(ary, i));
- if (st_delete(RHASH_TBL(hash), &vv, 0)) {
+ if (st_delete(rb_hash_tbl_raw(hash), &vv, 0)) {
rb_ary_push(uniq, v);
}
}