From 451d0665a4689173c470ac1e2395c1741f6919c6 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 13 Sep 2023 20:04:03 +0300 Subject: [PATCH] insndb/core: refactor operands traversal --- src/openpower/insndb/core.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index 29fec725..d2b44715 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -3764,18 +3764,10 @@ class Walker(mdis.walker.Walker): @mdis.dispatcher.Hook(Record) def dispatch_record(self, node): - self.__record = node for field in _dataclasses.fields(node): key = field.name value = getattr(node, key) yield (value, node, key, mdis.walker.AttributePath) yield (node.opcodes, node, "opcodes", mdis.walker.AttributePath) - - @mdis.dispatcher.Hook(Operands) - def dispatch_operands(self, node): - def hook(cls_kwargs): - (cls, kwargs) = cls_kwargs - return cls(record=self.__record, **kwargs) - - yield from self(tuple(map(hook, node))) + yield (node.operands, node, "operands", mdis.walker.AttributePath) -- 2.30.2