]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/auth_log: Pre-compile GUID regex
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 23 May 2023 04:37:30 +0000 (16:37 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 29 May 2023 22:32:28 +0000 (22:32 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/auth_log_base.py

index ebe9c3a124ab310267160db8bc6753df1e55a4eb..bc903168775afa1eb0709b4de65a82999d67986d 100644 (file)
@@ -147,10 +147,11 @@ class AuthLogTestBase(samba.tests.TestCase):
 
         return list(filter(is_not_netlogon, messages))
 
-    GUID_RE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
+    GUID_RE = re.compile(
+        "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
 
     #
     # Is the supplied GUID string correctly formatted
     #
     def is_guid(self, guid):
-        return re.match(self.GUID_RE, guid)
+        return self.GUID_RE.match(guid)