Skip to content

Commit 4ae5b64

Browse files
alexander-yakushevbbatsov
authored andcommitted
[misc] Remove unused misc functions
1 parent 5f45b2d commit 4ae5b64

File tree

4 files changed

+2
-29
lines changed

4 files changed

+2
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- `orchard.namespace/read-namespace`, `orchard.namespace/ensure-namespace`
77
- `orchard.meta/var-meta-whitelist`
88
- `orchard.inspect/set-page-size`, `orchard.inspect/set-max-atom-length`, `orchard.inspect/set-max-value-length`, `orchard.inspect/set-max-coll-size`, `orchard.inspect/set-max-nested-depth`
9+
* [#318](https://github.com/clojure-emacs/orchard/pull/318): **BREAKING:** Remove no longer used functions: `orchard.misc/lazy-seq?`, `orchard.misc/safe-count`, `orchard.misc/normalize-subclass`, `orchard.misc/remove-type-param`.
910

1011
## 0.30.1 (2025-02-24)
1112

src/orchard/java/parser_next.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
(= kind TypeKind/TYPEVAR)
384384
(upper-bound type))
385385
str
386-
misc/remove-type-param
386+
(string/replace #"<.*>" "") ;; Remove generics
387387
symbol)]
388388
(some-> (or best
389389
(type->sym element))

src/orchard/misc.clj

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,3 @@
158158
(fn [& args]
159159
(when resolved-fn
160160
(apply resolved-fn args)))))
161-
162-
(defn lazy-seq?
163-
"Return true if `x` is a lazy seq, otherwise false."
164-
[x]
165-
(and (seq? x) (not (counted? x))))
166-
167-
(defn safe-count
168-
"Call `clojure.core/count` on `x` if it is a collection, but not a lazy seq."
169-
[x]
170-
(when (and (coll? x) (not (lazy-seq? x)))
171-
(count x)))
172-
173-
(defn normalize-subclass [s]
174-
(string/replace s "$" "."))
175-
176-
(defn remove-type-param [s]
177-
(string/replace s #"<.*>" ""))

test/orchard/misc_test.clj

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,3 @@
7070
(is (= 1 (f 1))))
7171
(let [f (misc/call-when-resolved 'com.example/unknown)]
7272
(is (nil? (f 1)))))
73-
74-
(deftest lazy-seq?
75-
(is (misc/lazy-seq? (repeat 1)))
76-
(is (not (misc/lazy-seq? nil)))
77-
(is (not (misc/lazy-seq? [1 2 3])))
78-
(is (not (misc/lazy-seq? :not-a-seq))))
79-
80-
(deftest safe-count
81-
(is (= 3 (misc/safe-count [1 2 3])))
82-
(is (nil? (misc/safe-count (repeat 1))))
83-
(is (nil? (misc/safe-count :not-a-seq))))

0 commit comments

Comments
 (0)