summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-04 07:04:11 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-04 07:04:11 +0000
commitd37e836a58ac1ac680ee8716ab1f0b4fc00a1f89 (patch)
tree5ae16bdd5c133719946c2b4ba4db6784f845187e /hash.c
parenta38c2ac2dd0480502d83ad73fce54f25c993ab91 (diff)
* io.c (rb_io_popen): do not call rb_io_close() directly, call
"close" method instead. [ruby-dev:19717] * io.c (rb_io_s_open): ditto. * hash.c (rb_any_hash): remove DEFER_INTS. all do_hash() calls in st.c are at the top of functions. No reentrant problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 81b882e..1bb4c93 100644
--- a/hash.c
+++ b/hash.c
@@ -65,6 +65,8 @@ rb_any_cmp(a, b)
VALUE a, b;
{
VALUE args[2];
+
+ if (a == b) return 0;
if (FIXNUM_P(a) && FIXNUM_P(b)) {
return a != b;
}
@@ -72,10 +74,10 @@ rb_any_cmp(a, b)
TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) {
return rb_str_cmp(a, b);
}
+ if (a == Qundef || b == Qundef) return -1;
if (SYMBOL_P(a) && SYMBOL_P(b)) {
return a != b;
}
- if (a == Qundef || b == Qundef) return -1;
args[0] = a;
args[1] = b;
@@ -99,12 +101,10 @@ rb_any_hash(a)
break;
default:
- DEFER_INTS;
hval = rb_funcall(a, id_hash, 0);
if (!FIXNUM_P(hval)) {
hval = rb_funcall(hval, '%', 1, INT2FIX(536870923));
}
- ENABLE_INTS;
return (int)FIX2LONG(hval);
}
}