summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-26 05:28:24 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-26 05:28:24 (GMT)
commit4ce4f43f914dd8988bc7c78a30641d1911d20b98 (patch)
tree6e20b82ad2be1c371a62d49d8339f7ee4f02cca8 /hash.c
parent3a247f648913997c248c51c47a15fee08e5083f3 (diff)
hash.c: remove dead code
* hash.c (rb_hash_reject): remove dead code for the deprecated behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/hash.c b/hash.c
index 004ee92..279461f 100644
--- a/hash.c
+++ b/hash.c
@@ -31,7 +31,6 @@
((klass = has_extra_methods(rb_obj_class(hash))) != 0) || \
FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
!NIL_P(RHASH_IFNONE(hash)))
-#define HASH_REJECT_COPY_EXTRA_STATES 0
static VALUE
has_extra_methods(VALUE klass)
@@ -291,7 +290,7 @@ rb_hash_new(void)
return hash_alloc(rb_cHash);
}
-static VALUE
+static inline VALUE
rb_hash_dup_empty(VALUE hash)
{
NEWOBJ_OF(ret, struct RHash,
@@ -1146,34 +1145,10 @@ rb_hash_reject(VALUE hash)
if (RTEST(ruby_verbose)) {
VALUE klass;
if (HAS_EXTRA_STATES(hash, klass)) {
-#if HASH_REJECT_COPY_EXTRA_STATES
- rb_warn("copying extra states: %+"PRIsVALUE, hash);
- rb_warn("following states will not be copied in the future version:");
- if (klass) {
- rb_warn(" subclass: %+"PRIsVALUE, klass);
- }
- if (FL_TEST(hash, FL_EXIVAR)) {
- rb_warn(" instance variables: %+"PRIsVALUE,
- rb_obj_instance_variables(hash));
- }
- if (FL_TEST(hash, FL_TAINT)) {
- rb_warn(" taintedness");
- }
- if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- rb_warn(" default proc: %+"PRIsVALUE, RHASH_IFNONE(hash));
- }
- else if (!NIL_P(RHASH_IFNONE(hash)))
- rb_warn(" default value: %+"PRIsVALUE, RHASH_IFNONE(hash));
-#else
rb_warn("extra states are no longer copied: %+"PRIsVALUE, hash);
-#endif
}
}
-#if HASH_REJECT_COPY_EXTRA_STATES
- result = rb_hash_dup_empty(hash);
-#else
result = rb_hash_new();
-#endif
if (!RHASH_EMPTY_P(hash)) {
rb_hash_foreach(hash, reject_i, result);
}