Module: tools Branch: master Commit: f65fa587273a3130ec69f04a26f3ce1d17fe503d URL: http://source.winehq.org/git/tools.git/?a=commit;h=f65fa587273a3130ec69f04a2...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Jun 12 10:15:45 2014 +0200
testbot/lib: Simplify and optimize Collection::Validate().
---
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)