simplify create_args
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 5 Oct 2020 00:47:54 +0000 (17:47 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 5 Oct 2020 00:47:54 +0000 (17:47 -0700)
src/soc/decoder/isa/caller.py

index bf84e05a4f6e5e4f383e89f51c3c7a2852f0a43e..9252bfef12369e1851d01abd47886de68a177f5e 100644 (file)
@@ -61,10 +61,7 @@ REG_SORT_ORDER = {
 
 
 def create_args(reglist, extra=None):
-    regset = OrderedSet(reglist)
-    retval = []
-    for reg in regset:
-        retval.append(reg)
+    retval = list(OrderedSet(reglist))
     retval.sort(key=lambda reg: REG_SORT_ORDER[reg])
     if extra is not None:
         return [extra] + retval