clslgrnc / tbrop

Unnecessary use of comprehension PYL-R1721
Performance
Major
10 months ago10 months old
Unnecessary use of a comprehension, use list(self.instList) instead.
466
467    def copy(self):
468        gdgt = Gadget(self.arch)
469        gdgt.instList = [i for i in self.instList]470        gdgt.firstInst = self.firstInst
471        gdgt.gadgetMatrix = self.gadgetMatrix.copy()
472        gdgt.max_cost = self.max_cost
Unnecessary use of a comprehension, use list(range(sF, sL + 1)) instead.
124    stackTop = gdgtCollection.arch.stackTop
125    sL = gdgtCollection.arch.stackLast
126
127    STACK_codes = [i for i in range(sF, sL + 1)]128    STACK_strings = ["stack_" + str(i - stackTop) for i in range(sF, sL + 1)]
129
130    deref = gdgtCollection.arch.deref