From 136a046a87313cca424836d34c61dda02616b13b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 18 Sep 2022 18:25:21 +0100 Subject: [PATCH] remove f"" use simpler code, easier to read --- src/openpower/decoder/power_insn.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 1f216388..c54c5ca0 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1927,19 +1927,18 @@ class SVP64Instruction(PrefixedInstruction): Rc = bool(record.mdwn.operands["Rc"].value) rm = self.prefix.rm.select(record=record, Rc=Rc) - specifiers = tuple(rm.specifiers(record=record)) - if specifiers: - specifiers = "/".join(specifiers) - specifiers = f"/{specifiers}" - else: - specifiers = "" + # convert specifiers to /x/y/z + specifiers = list(rm.specifiers(record=record)) + if specifiers: # if any add one extra to get the extra "/" + specifiers = ['']+specifiers + specifiers = "/".join(specifiers) + # convert operands to " ,x,y,z" operands = tuple(map(_operator.itemgetter(1), self.dynamic_operands(db=db, verbosity=verbosity))) - if operands: - operands = f" {','.join(operands)}" - else: - operands = "" + operands = ','.join(operands) + if operands: # if any separate with a space + operands = " " + operands yield f"{blob_prefix}{name}{specifiers}{operands}" if blob_suffix: -- 2.30.2