clslgrnc / tbrop

Consider using identity comparison with singleton PTC-W0068
Bug risk
Major
10 months ago10 months old
Comparison to singleton None should be expr is None
460        return totalcost
461
462    def canBeExtended(self, max_cost=None):
463        if max_cost == None:464            max_cost = self.max_cost
465        return self.cost() < max_cost
466
Comparison to singleton None should be expr is not None
279
280    def copy(self):
281        gdgtCpy = GadgetMatrix(self.arch)
282        if self.chainCond != None:283            gdgtCpy.chainCond = self.chainCond.copy()
284        gdgtCpy.matrix = self.matrix.copy()
285        gdgtCpy.inst = self.inst
Comparison to singleton None should be expr is None
267        instMatrix = self.lookupFromCache(inst)
268
269        # init chain cond or update
270        if self.chainCond == None:271            self.initChainCond(inst)
272        else:
273            # TODO: Hypothesis no side effect on chainInst
Comparison to singleton None should be expr is None
216
217    def initChainCond(self, chainInst):
218
219        if self.inst == None:220            self.inst = chainInst
221        self.matrix = sparse.identity(self.arch.size, dtype=bool).tocsr()
222        # groups = chainInst.groups
Comparison to singleton None should be expr is not None
211        self.nbrInsts = 0
212        self.nbrBytes = 0
213
214        if chainInst != None:215            self.addInst(chainInst)
216
217    def initChainCond(self, chainInst):