summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index e35aabe6ac..b546f6246b 100644
--- a/hash.c
+++ b/hash.c
@@ -747,11 +747,14 @@ ar_free_and_clear_table(VALUE hash)
static void
ar_try_convert_table(VALUE hash)
{
- st_table *new_tab;
+ if (!RHASH_AR_TABLE_P(hash)) return;
+
const unsigned size = RHASH_AR_TABLE_SIZE(hash);
+
+ st_table *new_tab;
st_index_t i;
- if (!RHASH_AR_TABLE_P(hash) || size < RHASH_AR_TABLE_MAX_SIZE) {
+ if (size < RHASH_AR_TABLE_MAX_SIZE) {
return;
}