power_insn: check exact matches directly in set
authorDmitry Selyutin <ghostmansd@gmail.com>
Sat, 10 Sep 2022 19:38:30 +0000 (22:38 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 11 Sep 2022 13:33:00 +0000 (14:33 +0100)
src/openpower/decoder/power_insn.py

index e02024f5b413e9b7d0eddd750c0449e3043fab28..90aac4d0ae06812b9116397471e3109cb5c3df31 100644 (file)
@@ -1783,11 +1783,7 @@ class PPCDatabase:
 
     def __getitem__(self, key):
         def exact_match(key, record):
-            for name in record.names:
-                if name == key:
-                    return True
-
-            return False
+            return (key in record.names)
 
         def Rc_match(key, record):
             if not key.endswith("."):