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

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

    
6
---
7
 hash.c | 2 --
8
 1 file changed, 2 deletions(-)
9

    
10
diff --git a/hash.c b/hash.c
11
index 808544793b..f91958ff0f 100644
12
--- a/hash.c
13
+++ b/hash.c
14
@@ -2790,8 +2790,6 @@ rb_hash_initialize_copy(VALUE hash, VALUE hash2)
15
     rb_hash_modify_check(hash);
16
     hash2 = to_hash(hash2);
17
 
18
-    Check_Type(hash2, T_HASH);
19
-
20
     if (hash == hash2) return hash;
21
 
22
     if (RHASH_AR_TABLE_P(hash2)) {
23
-- 
24
2.21.0
25