summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2011-01-12 22:56:41 +0000
committerpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2011-01-12 22:56:41 +0000
commit41a77f12c91d9348362e38f8fe00df235b85e907 (patch)
treeed8eff7e4e5736378c62caaaccba42fde4de5fba
parent121f519665fe98a59c5a836c57afeedcdd381c7f (diff)
downloadipaddr-py-41a77f12c91d9348362e38f8fe00df235b85e907.tar.gz
+ small speedup, remove the redundant call to explode_short_ip_string
git-svn-id: https://ipaddr-py.googlecode.com/svn@200 09200d28-7f98-11dd-ad27-0f66e57d2035
-rw-r--r--trunk/ipaddr.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/trunk/ipaddr.py b/trunk/ipaddr.py
index 0e35858..dff40d3 100644
--- a/trunk/ipaddr.py
+++ b/trunk/ipaddr.py
@@ -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):