From e73d32b07d132a00f0b001a8bac1d3014fb23a6c Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 28 May 2006 02:46:57 +0000 Subject: [PATCH] make separate-path-strings even cleaner svn: r3091 --- collects/net/url-unit.ss | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/collects/net/url-unit.ss b/collects/net/url-unit.ss index 1b49813299..36437440bd 100644 --- a/collects/net/url-unit.ss +++ b/collects/net/url-unit.ss @@ -420,12 +420,8 @@ ;; separate-path-strings : string[starting with /] -> (listof path/param) (define (separate-path-strings str) - (if (string=? str "") - '() - (let ([str (if (char=? #\/ (string-ref str 0)) - (substring str 1 (string-length str)) - str)]) - (map separate-params (regexp-split #rx"/" str))))) + (let ([strs (regexp-split #rx"/" str)]) + (map separate-params (if (string=? "" (car strs)) (cdr strs) strs)))) (define (separate-params s) (let ([lst (map path-segment-decode (regexp-split #rx";" s))])