Project

General

Profile

Bug #16121 » 0001-Remove-redundant-Check_Type-after-to_hash.diff.txt

[PATCH 1/4] Remove redundant Check_Type after to_hash - dylants (Dylan Thacker-Smith), 08/23/2019 07:55 PM

 
From 86a564908bd29035001bf89d380db4803c9b3b68 Mon Sep 17 00:00:00 2001
From: Dylan Thacker-Smith <Dylan.Smith@shopify.com>
Date: Fri, 23 Aug 2019 15:35:17 -0400
Subject: [PATCH 1/4] Remove redundant Check_Type after to_hash

---
hash.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/hash.c b/hash.c
index 808544793b..f91958ff0f 100644
--- a/hash.c
+++ b/hash.c
@@ -2790,8 +2790,6 @@ rb_hash_initialize_copy(VALUE hash, VALUE hash2)
rb_hash_modify_check(hash);
hash2 = to_hash(hash2);
- Check_Type(hash2, T_HASH);
-
if (hash == hash2) return hash;
if (RHASH_AR_TABLE_P(hash2)) {
--
2.21.0

(1-1/4)