Francois Gouget : testbot: Slightly speed up the Item property accesses.

Alexandre Julliard julliard at winehq.org
Wed Apr 13 15:08:39 CDT 2022


Module: tools
Branch: master
Commit: b43a450b41112f72b8c4ef4a20325a35784fb8da
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=b43a450b41112f72b8c4ef4a20325a35784fb8da

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Apr 13 19:08:17 2022 +0200

testbot: Slightly speed up the Item property accesses.

substr()+rindex() is a bit faster than the regular expression for
separating the class name from the property name.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/ObjectModel/Item.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testbot/lib/ObjectModel/Item.pm b/testbot/lib/ObjectModel/Item.pm
index 9cec7b4..c086aec 100644
--- a/testbot/lib/ObjectModel/Item.pm
+++ b/testbot/lib/ObjectModel/Item.pm
@@ -228,9 +228,8 @@ sub AUTOLOAD
 {
   my $self = shift;
 
-  my $PropertyName = $ObjectModel::Item::AUTOLOAD;
   # strip fully-qualified portion
-  $PropertyName =~ s/.*://;
+  my $PropertyName = substr($ObjectModel::Item::AUTOLOAD, rindex($ObjectModel::Item::AUTOLOAD, ':') + 1);
   if ($PropertyName eq "DESTROY")
   {
     return;




More information about the wine-cvs mailing list