Francois Gouget : testbot: Fix the CompareRecordGroups() documentation and variable names.
julliard at winehq.org
Wed Jan 17 14:10:53 CST 2018
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Wed Jan 17 01:23:05 2018 +0100
testbot: Fix the CompareRecordGroups() documentation and variable names.
The RecordGroup Id is an AUTO_INCREMENT field. These never wrap!
Also, while that field is defined as an INT(6), it is a 32 bit integer
anyway so we will not run out of ids for a long time. Generally
speaking, for integers the display width (6 here) is meaningless as far
as the TestBot is concerned.
Also use more descriptive variable names. $a and $b were a bit
misleading too since they have special meaning in the context of the
sort() function, meaning which they don't have here.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
testbot/lib/WineTestBot/RecordGroups.pm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/testbot/lib/WineTestBot/RecordGroups.pm b/testbot/lib/WineTestBot/RecordGroups.pm
index fc1c252..707d0ac 100644
@@ -95,12 +95,12 @@ sub CreateRecordGroups(;$)
- my ($a, $b) = @_;
+ my ($RecordGroup1, $RecordGroup2) = @_;
- # The Id will wrap eventually so sort by Timestamp
- # and only use the Id to break ties.
- return $a->Timestamp <=> $b->Timestamp ||
- $a->Id <=> $b->Id;
+ # The Timestamps have a 1 second granularity and may have duplicates.
+ # So use the Id to break ties.
+ return $RecordGroup1->Timestamp <=> $RecordGroup2->Timestamp ||
+ $RecordGroup1->Id <=> $RecordGroup2->Id;
More information about the wine-cvs