]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/urls/urls.factor
sequences: use index-of-last more places
[factor.git] / basis / urls / urls.factor
index b9f23f4641dbad41de27623031aea272a80773c4..c78a44bd4eaeccaa02156db1aaa50bf5f25f9019 100644 (file)
@@ -120,7 +120,7 @@ M: pathname >url string>> >url ;
 
 : ipv6-host ( host -- host/ipv6 ipv6? )
     dup { [ "[" head? ] [ "]" tail? ] } 1&& [
-        1 swap [ length 1 - ] [ subseq ] bi t
+        1 swap index-of-last subseq t
     ] [ f ] if ;
 
 : unparse-host ( url -- host )