testbot/lib: Simplify and optimize Collection::Validate().

Francois Gouget fgouget at codeweavers.com
Thu Jun 12 03:15:45 CDT 2014


---
 testbot/lib/ObjectModel/Collection.pm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/testbot/lib/ObjectModel/Collection.pm b/testbot/lib/ObjectModel/Collection.pm
index 7dbcf63..0070c57 100644
--- a/testbot/lib/ObjectModel/Collection.pm
+++ b/testbot/lib/ObjectModel/Collection.pm
@@ -409,18 +409,14 @@ sub Validate
       if ($Item->GetIsNew())
       {
         my $HasSequenceKey = !1;
-        my $ErrProperty, my $ErrMessage;
         foreach my $PropertyDescriptor (@{$self->{PropertyDescriptors}})
         {
-          if ($PropertyDescriptor->GetIsKey())
+          if ($PropertyDescriptor->GetIsKey() &&
+              $PropertyDescriptor->GetClass() eq "Basic" &&
+              $PropertyDescriptor->GetType() eq "S")
           {
-            $ErrProperty = $PropertyDescriptor->GetName();
-            $ErrMessage = $Item->$ErrProperty;
-            if ($PropertyDescriptor->GetClass() eq "Basic" &&
-                $PropertyDescriptor->GetType() eq "S")
-            {
-              $HasSequenceKey = 1;
-            }
+            $HasSequenceKey = 1;
+            last;
           }
         }
         if (! $HasSequenceKey)
-- 
2.0.0




More information about the wine-patches mailing list