diff options
author | Paul Jimenez <pj@place.org> | 2018-08-30 15:49:58 -0400 |
---|---|---|
committer | Paul Jimenez <pj@place.org> | 2018-09-08 17:36:51 -0400 |
commit | 5d764842f1da7f7d8218678ab75e33d29d0abb7e (patch) | |
tree | d3339d8e10752473eec710317867f8d66113e13f /python.d | |
parent | de492fc89d11369770053672878e7b41ab4c7052 (diff) |
Optimize counting of recusive pins
Avoid building (potentially large) unneeded list of strings
Diffstat (limited to 'python.d')
-rw-r--r-- | python.d/ipfs.chart.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python.d/ipfs.chart.py b/python.d/ipfs.chart.py index bd553b42c6..e17ff7dee0 100644 --- a/python.d/ipfs.chart.py +++ b/python.d/ipfs.chart.py @@ -74,7 +74,7 @@ class Service(UrlService): @staticmethod def _recursive_pins(keys): - return len([k for k in keys if keys[k]["Type"] == b"recursive"]) + return sum( 1 for k in keys if keys[k]["Type"] == b"recursive" ) @staticmethod def _dehumanize(store_max): |