diff options
author | Peter Moody <pmoody@google.com> | 2011-01-12 22:56:41 +0000 |
---|---|---|
committer | Peter Moody <pmoody@google.com> | 2011-01-12 22:56:41 +0000 |
commit | 381d0c46710032afd8acfb3284c88e143b21d5ac (patch) | |
tree | 8a59ee9e66116fb227a0f1b7e379dbb54c0a49d8 /ipaddr.py | |
parent | 46c3e3ef02627e5ab48952b348a765be5719f03c (diff) | |
download | ipaddr-py-381d0c46710032afd8acfb3284c88e143b21d5ac.tar.gz |
+ small speedup, remove the redundant call to explode_short_ip_string
git-svn-id: https://ipaddr-py.googlecode.com/svn/trunk@200 09200d28-7f98-11dd-ad27-0f66e57d2035
Diffstat (limited to 'ipaddr.py')
-rw-r--r-- | ipaddr.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1758,10 +1758,9 @@ class _BaseV6(object): Note: This doesn't try to verify that the address is a teredo address """ - server_bits = self._explode_shorthand_ip_string().split(':')[2:4] - client_bits = self._explode_shorthand_ip_string().split(':')[6:] - return (IPv4Address(int(''.join(server_bits), 16)), - IPv4Address(int(''.join(client_bits), 16) ^ 0xFFFFFFFF)) + bits = self._explode_shorthand_ip_string().split(':') + return (IPv4Address(int(''.join(bits[2:4]), 16)), + IPv4Address(int(''.join(bits[6:]), 16) ^ 0xFFFFFFFF)) class IPv6Address(_BaseV6, _BaseIP): |