Optimize counting of recusive pins
Avoid building (potentially large) unneeded list of strings
Paul Jimenez committed
Aug 30, 2018 at 15:49 UTC
5d764842f1da7f7d8218678ab75e33d29d0abb7e
1 file changed
+1
-1
python.d/ipfs.chart.py
+1
-1
@@ -74,7 +74,7 @@ class Service(UrlService):
74
75
@staticmethod
76
def _recursive_pins(keys):
77
- return len([k for k in keys if keys[k]["Type"] == b"recursive"])
77
+ return sum( 1 for k in keys if keys[k]["Type"] == b"recursive" )
78
79
@staticmethod
80
def _dehumanize(store_max):