def _feature_loopcount(self, f_ea):
'''
Generate a block graph, then get loopcount via DiGraph.number_of_selfloops()
prior feature: Null
'''
DEBUG_PRINT( 'feature_loopcount' + hex(f_ea))
loopcount = 0
mloops = set()
# loops = map(lambda loop: sorted(loop),nx.simple_cycles(self.ftable["dg"]))
# sorted too slow, use min instead
self.loops = {}
self.loops = simple_cycles(self.ftable["dg"])
# if loops is None:
# return 0
# # mloops = map(lambda loop : min(loop), loops)
# # loopcount = len(sets(mloops))
# for loop in loops:
# mloop = min(loop)
# mloops.add(mloop)
# loopcount = len(mloops)
loopcount = len(self.loops)
return loopcount
评论列表
文章目录