Skip to content

Commit

Permalink
use arrays, not hashes, as indices are numerical only
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Jun 21, 2011
1 parent a3d0c1c commit 255fb41
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/FusionInventory/Agent/Task/NetDiscovery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ sub run {
$iplist = &share({});
my $loop_nbthreads : shared;
my $sendbylwp : shared;
my $sentxml = {};

while ($loop_action > 0) {
$countnb = 0;
Expand Down Expand Up @@ -291,34 +290,38 @@ sub run {
});
}

my $sentxml;

while ($exit != 1) {
sleep 2;
foreach my $idx (1..$maxIdx) {
next if defined $sentxml->{$idx};
next if defined $sentxml->[$idx];

my $data = $storage->restore(
idx => $idx
);

$self->_sendInformations($data);
$sentxml->{$idx} = 1;
$storage->remove(
idx => $idx
);

$sentxml->[$idx] = 1;
sleep 1;
}
}

foreach my $idx (1..$maxIdx) {
next if defined $sentxml->{$idx};
next if defined $sentxml->[$idx];

my $data = $storage->restore(
idx => $idx
);

$self->_sendInformations($data);
$sentxml->{$idx} = 1;
$storage->remove(
idx => $idx
);

$sentxml->[$idx] = 1;
sleep 1;
}
}
Expand Down

0 comments on commit 255fb41

Please sign in to comment.