Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added minor splitting optimization in django.utils.ipv6._unpack_ipv4

  • Loading branch information...
commit 127d9b2792131995caf87c16b73dbd61f360de2a 1 parent fffb558
Danilo Bargen authored November 07, 2012 timgraham committed June 01, 2013

Showing 1 changed file with 1 addition and 2 deletions. Show diff stats Hide diff stats

  1. 3  django/utils/ipv6.py
3  django/utils/ipv6.py
@@ -138,8 +138,7 @@ def _unpack_ipv4(ip_str):
138 138
     if not ip_str.lower().startswith('0000:0000:0000:0000:0000:ffff:'):
139 139
         return None
140 140
 
141  
-    hextets = ip_str.split(':')
142  
-    return hextets[-1]
  141
+    return ip_str.rsplit(':', 1)[1]
143 142
 
144 143
 def is_valid_ipv6_address(ip_str):
145 144
     """

0 notes on commit 127d9b2

Please sign in to comment.
Something went wrong with that request. Please try again.