Commit 6ba10a1b authored by gerv%gerv.net's avatar gerv%gerv.net

Whitespace changes only; removing tabs and reformatting my changes to match the…

Whitespace changes only; removing tabs and reformatting my changes to match the rest of the file. Long overdue.
parent 70e7519e
......@@ -93,6 +93,7 @@ sub collect_stats {
} else {
SendSQL("select count(resolution) from bugs where resolution='$resolution' and product='$product'");
}
push @row, FetchOneColumn();
}
......@@ -107,6 +108,7 @@ sub collect_stats {
# Created: $when
FIN
}
print DATA (join '|', @row) . "\n";
close DATA;
} else {
......@@ -128,8 +130,7 @@ sub calculate_dupes {
# Save % count here in a date-named file
# so we can read it back in to do changed counters
# First, delete it if it exists, so we don't add to the contents of an old file
if (-e "data/mining/dupes$today.db")
{
if (-e "data/mining/dupes$today.db") {
system("rm -f data/mining/dupes$today.db");
}
......@@ -137,8 +138,7 @@ sub calculate_dupes {
# Create a hash with key "a bug number", value "bug which that bug is a
# direct dupe of" - straight from the duplicates table.
while (@row = FetchSQLData())
{
while (@row = FetchSQLData()) {
my $dupe_of = shift @row;
my $dupe = shift @row;
$dupes{$dupe} = $dupe_of;
......@@ -151,8 +151,7 @@ sub calculate_dupes {
{
my $dupe_of = $dupes{$key};
if (!defined($count{$dupe_of}))
{
if (!defined($count{$dupe_of})) {
$count{$dupe_of} = 0;
}
......@@ -164,16 +163,13 @@ sub calculate_dupes {
while ($changed == 1)
{
$changed = 0;
foreach $key (keys(%count))
{
foreach $key (keys(%count)) {
# if this bug is actually itself a dupe, and has a count...
if (defined($dupes{$key}) && $count{$key} > 0)
{
if (defined($dupes{$key}) && $count{$key} > 0) {
# add that count onto the bug it is a dupe of,
# and zero the count; the check is to avoid
# loops
if ($count{$dupes{$key}} != 0)
{
if ($count{$dupes{$key}} != 0) {
$count{$dupes{$key}} += $count{$key};
$count{$key} = 0;
$changed = 1;
......@@ -185,8 +181,7 @@ sub calculate_dupes {
# Remove the values for which the count is zero
foreach $key (keys(%count))
{
if ($count{$key} == 0)
{
if ($count{$key} == 0) {
delete $count{$key};
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment