]> git.ipfire.org Git - location/libloc.git/commitdiff
export: Speed-up export in xt_geoip format
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Nov 2020 12:41:19 +0000 (12:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Nov 2020 12:41:19 +0000 (12:41 +0000)
Removing the loop avoids creating a tuple and then iterating over it

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/export.py

index 4702bcfa08edf0ec7a1c27e8797011d625f8f2dc..f0eae2644fc0a8411ae70c28a5666cb91f6fceeb 100644 (file)
@@ -120,8 +120,8 @@ class XTGeoIPOutputWriter(OutputWriter):
        mode = "wb"
 
        def write(self, network):
-               for address in (network._first_address, network._last_address):
-                       self.f.write(address)
+               self.f.write(network._first_address)
+               self.f.write(network._last_address)
 
 
 formats = {