mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Explicitly cast to unsigned long to fix the sign-compare warning
This commit is contained in:
1 file changed
+2
-1
@@ -1941,7 +1941,8 @@ rb_hash_init(rb_execution_context_t *ec, VALUE hash, VALUE capa_value, VALUE ifn
|
||||
|
||||
if (capa_value != INT2FIX(0)) {
|
||||
long capa = NUM2LONG(capa_value);
|
||||
if (capa > 0 && RHASH_AR_TABLE_P(hash) && RHASH_SIZE(hash) == 0 && capa > RHASH_AR_TABLE_MAX_BOUND(hash)) {
|
||||
if (capa > 0 && RHASH_AR_TABLE_P(hash) && RHASH_SIZE(hash) == 0 &&
|
||||
(unsigned long)capa > RHASH_AR_TABLE_MAX_BOUND(hash)) {
|
||||
hash_st_table_init(hash, capa);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user