deepcopy is really slow and actually unnecessary here
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 14 Jun 2023 05:54:28 +0000 (22:54 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Wed, 14 Jun 2023 05:54:28 +0000 (22:54 -0700)
src/openpower/fpscr.py

index d4e8a1d7612a6b12f33ef8b8fe8e4e1880db5905..edfcfacacb0228a45159ebf244fff92b07af1a5c 100644 (file)
@@ -136,9 +136,7 @@ class FPSCRState(SelectableInt):
         offs = 0
         # set up sub-fields from Record layout
         self.fsi = {}
-        l = deepcopy(FPSCRRecord.layout)
-        l.reverse()
-        for field, width in l:
+        for field, width in reversed(FPSCRRecord.layout):
             if field == "FPRF":
                 v = FPSCR_FPRF(self, tuple(range(47, 52)))
                 end = 52