From c4e0a991c6695a8e8382aeeee884694719326b1f Mon Sep 17 00:00:00 2001 From: Pekka Laiho Date: Thu, 24 Dec 2020 08:18:43 +0700 Subject: [PATCH] remove first-or-null, not required because first returns null already --- mad/util.mad | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mad/util.mad b/mad/util.mad index c80f99b..803fce8 100644 --- a/mad/util.mad +++ b/mad/util.mad @@ -3,9 +3,6 @@ ;; Generic utility functions. ;; -;; Return first item of sequence, or null if it is empty. -(defn first-or-null (seq) (if (empty? seq) null (first seq))) - ;; Split string by whitespace, removing empty strings. (defn split-ws (s) (re-split "/[\\s]+/" s)) @@ -13,4 +10,4 @@ ;; Useful for parsing a string for command name and arguments. (defn str-first-rest (s) (let (words (split-ws s)) - [(first-or-null words) (tail words)])) + [(first words) (tail words)]))