summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-05-19 20:17:55 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-05-19 20:17:55 +0000
commit14cade97ead1fce5346533c9ffae161becee82db (patch)
tree23612c7ce187d6601ddf10fd73bea37e5d76d527 /sv.c
parent136e4fd6ec637207d88e6a730d1dc2f630367cae (diff)
downloadperl-14cade97ead1fce5346533c9ffae161becee82db.tar.gz
[perl #29637] Thread creation time is hypersensitive
Due to a logic error, the dup ptr table sometimes wans't being grown, leading to extremely slow cloning. p4raw-id: //depot/perl@22830
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index f4c1cbe0a3..4be4a7fa3f 100644
--- a/sv.c
+++ b/sv.c
@@ -10400,11 +10400,11 @@ Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv)
* hash values e.g. if they grow faster in the most significant
* bits */
UV hash = PTR2UV(oldv);
- bool i = 1;
+ bool empty = 1;
assert(tbl);
otblent = &tbl->tbl_ary[hash & tbl->tbl_max];
- for (tblent = *otblent; tblent; i=0, tblent = tblent->next) {
+ for (tblent = *otblent; tblent; empty=0, tblent = tblent->next) {
if (tblent->oldval == oldv) {
tblent->newval = newv;
return;
@@ -10416,7 +10416,7 @@ Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv)
tblent->next = *otblent;
*otblent = tblent;
tbl->tbl_items++;
- if (i && tbl->tbl_items > tbl->tbl_max)
+ if (!empty && tbl->tbl_items > tbl->tbl_max)
ptr_table_split(tbl);
}