From e8f8cf111fc1cd6ee7a00b692ba208bd1c7ce539 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 2 Apr 2019 03:48:58 +0000 Subject: date: use del_hash to extract an element destructively git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/date/date_parse.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ext/date/date_parse.c') diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index fcda847bd8..3237fb7f63 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -2177,7 +2177,7 @@ date__parse(VALUE str, VALUE comp) #endif { - if (RTEST(ref_hash("_bc"))) { + if (RTEST(del_hash("_bc"))) { VALUE y; y = ref_hash("cwyear"); @@ -2192,7 +2192,7 @@ date__parse(VALUE str, VALUE comp) } } - if (RTEST(ref_hash("_comp"))) { + if (RTEST(del_hash("_comp"))) { VALUE y; y = ref_hash("cwyear"); @@ -2215,9 +2215,6 @@ date__parse(VALUE str, VALUE comp) } - del_hash("_bc"); - del_hash("_comp"); - { VALUE zone = ref_hash("zone"); if (!NIL_P(zone) && NIL_P(ref_hash("offset"))) -- cgit v1.2.3