[rtems-central commit] validation: Simplify

Sebastian Huber sebh at rtems.org
Mon Mar 22 14:43:48 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    800935a199ecdabcc689a347ca8094825a22f49e
Changeset: http://git.rtems.org/rtems-central/commit/?id=800935a199ecdabcc689a347ca8094825a22f49e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sun Mar 21 13:02:19 2021 +0100

validation: Simplify

---

 rtemsspec/validation.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rtemsspec/validation.py b/rtemsspec/validation.py
index eec97c6..aedfd45 100644
--- a/rtemsspec/validation.py
+++ b/rtemsspec/validation.py
@@ -665,10 +665,10 @@ class TransitionMap:
                     f"transition map of {self._item.spec} contains no default "
                     "entry for pre-condition set "
                     f"{{{self._map_index_to_pre_conditions(map_idx)}}}")
-            entry = self._entries.get(transitions.key, [0, 0, transitions, []])
+            entry = self._entries.setdefault(transitions.key,
+                                             [0, 0, transitions, []])
             entry[0] += 1
             entry[3].append(map_idx)
-            self._entries[transitions.key] = entry
         for index, entry in enumerate(
                 sorted(self._entries.values(),
                        key=lambda x: x[0],



More information about the vc mailing list