]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/webapps/wee-url/wee-url.factor
factor: use ??if instead of ?if-old
[factor.git] / extra / webapps / wee-url / wee-url.factor
index 0d4388d7cbceca93a345b79ea5cf66c10143afe4..f1f9a82f936e4aab79e6477b2beb8c93f355d434 100644 (file)
@@ -26,8 +26,8 @@ short-url "SHORT_URLS" {
     '[ _ dup random-url >>short insert-tuple ] 10 retry ;
 
 : shorten ( url -- short )
-    short-url new swap >>url dup select-tuple
-    [ ] [ insert-short-url ] ?if short>> ;
+    short-url new swap >>url
+    [ select-tuple ] [ insert-short-url ] ?unless short>> ;
 
 : short>url ( short -- url )
     "$wee-url/go/" prepend >url adjust-url ;