projects
/
openpower-isa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c356c3
)
speed up StateSPRs.__init__
author
Jacob Lifshay
<programmerjake@gmail.com>
Wed, 14 Jun 2023 05:55:49 +0000
(22:55 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Wed, 14 Jun 2023 05:55:49 +0000
(22:55 -0700)
src/openpower/test/state.py
patch
|
blob
|
history
diff --git
a/src/openpower/test/state.py
b/src/openpower/test/state.py
index 5d61c27753a2d7754c5a590834a71d70ea53dcdb..99b6a175966da8042dd7965a0e027e8b19a60751 100644
(file)
--- a/
src/openpower/test/state.py
+++ b/
src/openpower/test/state.py
@@
-66,9
+66,13
@@
class StateRunner:
class StateSPRs:
KEYS = tuple(i for i in SPRfull if i != SPRfull.XER)
+ __EMPTY_VALUES = {k: 0 for k in KEYS}
def __init__(self, values=None):
- self.__values = {k: 0 for k in StateSPRs.KEYS}
+ if isinstance(values, StateSPRs):
+ self.__values = values.__values.copy()
+ return
+ self.__values = self.__EMPTY_VALUES.copy()
if values is not None:
for k, v in values.items():
self[k] = v