From 7b605bddc5907dd40f082d66b494c4bae046b4e9 Mon Sep 17 00:00:00 2001 From: Ivan Grishaev Date: Sun, 5 Dec 2021 10:22:40 +0300 Subject: [PATCH] add type hints for graalvm --- src/clojure_ini/core.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clojure_ini/core.clj b/src/clojure_ini/core.clj index 920cfa2..4547de7 100644 --- a/src/clojure_ini/core.clj +++ b/src/clojure_ini/core.clj @@ -2,8 +2,8 @@ (:require [clojure.string :as s] [clojure.java.io :as io])) -(defn- parse-line [s kw trim] - (if (= (first s) \[) +(defn- parse-line [^String s kw trim] + (if (= (first s) \[) (-> s (subs 1 (.indexOf s "]")) trim kw) (let [n (.indexOf s "=")] (if (neg? n) @@ -11,7 +11,7 @@ [(-> s (subs 0 n) trim kw) (-> s (subs (inc n)) trim)])))) -(defn- strip-comment [s chr allow-anywhere?] +(defn- strip-comment [^String s chr allow-anywhere?] (let [n (.indexOf s (int chr))] (if (and (not (neg? n)) (or allow-anywhere? @@ -60,6 +60,6 @@ (with-open [r (io/reader in)] (->> (line-seq r) (map #(strip-comment % comment-char allow-comments-anywhere?)) - (remove (fn [s] (every? #(Character/isWhitespace %) s))) + (remove (fn [s] (every? #(Character/isWhitespace ^char %) s))) (map #(parse-line % kw trim)) mapify))))