chiark / gitweb /
addr-family-ipv6.lisp (ipaddr-string): Upend the conditional.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Apr 2014 13:10:58 +0000 (14:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 22 Apr 2014 13:10:58 +0000 (14:10 +0100)
Put the simple fully-populated case first.

addr-family-ipv6.lisp

index 3c3790748918382df37085ea8c9be7786975f2a1..4bec06cf21d0649a85f97cd1507ac54263b31d15 100644 (file)
@@ -167,12 +167,12 @@ (defmethod ipaddr-string ((ip ip6addr))
                     (incf i)
                     (when (>= i end) (return))
                     (write-char #\: out))))))
                     (incf i)
                     (when (>= i end) (return))
                     (write-char #\: out))))))
-       (cond (best-start
+       (cond ((null best-start)
+              (chunk 0 8))
+             (t
               (chunk 0 best-start)
               (write-string "::" out)
               (chunk 0 best-start)
               (write-string "::" out)
-              (chunk (+ best-start best-length) 8))
-             (t
-              (chunk 0 8)))))))
+              (chunk (+ best-start best-length) 8)))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; IPv6 networks.
 
 ;;;--------------------------------------------------------------------------
 ;;; IPv6 networks.