Skip to content

Commit

Permalink
Merge pull request #247 from manuelm/gh246
Browse files Browse the repository at this point in the history
Sorting tree: Check if the key exists. Do not care about its value.
  • Loading branch information
eldy authored May 28, 2024
2 parents 3f14398 + 1326f2b commit a00190b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wwwroot/cgi-bin/awstats.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8481,7 +8481,7 @@ sub AddInTree {
}
return;
}
if ( $val{$keyval} ) { # Val is already in tree
if ( exists($val{$keyval}) ) { # Val is already in tree
if ($Debug) { debug( " val is already in tree", 4 ); }
$egal{$keytoadd} = $val{$keyval};
$val{$keyval} = $keytoadd;
Expand Down Expand Up @@ -8528,7 +8528,7 @@ sub AddInTree {
while ( $nextval{$valcursor} && ( $nextval{$valcursor} < $keyval ) ) {
$valcursor = $nextval{$valcursor};
}
if ( $nextval{$valcursor} )
if ( exists($nextval{$valcursor}) )
{ # keyval is between valcursor and nextval{valcursor}
$nextval{$keyval} = $nextval{$valcursor};
}
Expand Down Expand Up @@ -8556,7 +8556,7 @@ sub Removelowerval {
if ($Debug) {
debug( " remove for lowerval=$lowerval: key=$keytoremove", 4 );
}
if ( $egal{$keytoremove} ) {
if ( exists($egal{$keytoremove}) ) {
$val{$lowerval} = $egal{$keytoremove};
delete $egal{$keytoremove};
}
Expand Down

0 comments on commit a00190b

Please sign in to comment.