Use comprehensions instead of map/lambda (take 2)

This commit is contained in:
Alessio Sergi 2015-06-02 00:56:02 +02:00
parent dfe20754f6
commit 9e904d6204

View File

@ -120,4 +120,4 @@ class Plugin(GlancesPlugin):
Example: '255.255.255.0' will return 24
"""
return sum(map(lambda x: int(x) << 8, ip.split('.'))) // 8128
return sum([int(x) << 8 for x in ip.split('.')]) // 8128