testbot/lib: Assume the $MaxXxx configuration settings are always set.

Francois Gouget fgouget at codeweavers.com
Mon Oct 22 05:10:26 CDT 2012


There is no reason to leave them undefined when insanely large values like 100 can be used instead.
---

This simplifies the code a tiny bit.

 testbot/lib/WineTestBot/Jobs.pm |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 8ec9bb8..07a0685 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -464,7 +464,7 @@ sub ScheduleOnHost
         {
           my $VM = $HostVMs->GetItem($Task->VM->GetKey());
           if ($VM->Status eq "idle" &&
-              (! defined($MaxRunningVMs) || $RunningVMs < $MaxRunningVMs) &&
+              $RunningVMs < $MaxRunningVMs &&
               $RevertingVMs == 0)
           {
             $VM->Status("running");
@@ -507,11 +507,11 @@ sub ScheduleOnHost
   foreach $VMKey (@DirtyVMsByIndex)
   {
     my $VM = $HostVMs->GetItem($VMKey);
-    if (! defined($MaxRevertingVMs) || $RevertingVMs < $MaxRevertingVMs)
+    if ($RevertingVMs < $MaxRevertingVMs)
     {
       if ($VM->Type eq "extra" || $VM->Type eq "retired")
       {
-        if (! defined($MaxExtraPoweredOnVms) || $PoweredOnExtraVMs < $MaxExtraPoweredOnVms)
+        if ($PoweredOnExtraVMs < $MaxExtraPoweredOnVms)
         {
           $VM->RunRevert();
           $PoweredOnExtraVMs++;
@@ -529,7 +529,7 @@ sub ScheduleOnHost
   {
     my $VM = $HostVMs->GetItem($VMKey);
     if (! defined($DirtyVMsBlockingJobs{$VMKey}) &&
-        (! defined($MaxRevertingVMs) || $RevertingVMs < $MaxRevertingVMs) &&
+        $RevertingVMs < $MaxRevertingVMs &&
         $VM->Status eq 'dirty' && $VM->Type ne "extra" &&
         $VM->Type ne "retired")
     {
-- 
1.7.10.4




More information about the wine-patches mailing list