[PATCH] testbot/LogUtils: Skip the search for new errors if there is no error.

Francois Gouget fgouget at codeweavers.com
Mon Dec 2 06:52:50 CST 2019


This avoids loading and parsing the reference log when not needed.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/WineTestBot/LogUtils.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 282906e62..51932965c 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -888,10 +888,12 @@ sub GetNewLogErrors($$$)
 {
   my ($RefFileName, $Groups, $Errors) = @_;
 
+  my (@NewGroups, %NewErrors, %NewIndices);
+  return (\@NewGroups, \%NewErrors, \%NewIndices) if (!@$Groups);
+
   my ($RefGroups, $RefErrors) = GetLogErrors($RefFileName);
   return (undef, undef) if (!$RefGroups);
 
-  my (@NewGroups, %NewErrors, %NewIndices);
   foreach my $GroupName (@$Groups)
   {
     if ($RefErrors->{$GroupName})
-- 
2.20.1




More information about the wine-devel mailing list