Skip to content

Commit

Permalink
Perf optimization, fixes clj-kondo#1989
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Feb 16, 2023
1 parent 69f6d89 commit 0f31dfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ For a list of breaking changes, check [here](#breaking-changes).
- [#1979](https://github.com/clj-kondo/clj-kondo/issues/1979): allow `:level :off` in `:discouraged-var` config on var level
- [#1995](https://github.com/clj-kondo/clj-kondo/issues/1995): `clj-kondo.lint-as/def-catch-all` doesn't emit locations, fixes navigation for lsp
- [#1978](https://github.com/clj-kondo/clj-kondo/issues/1978): false positive type error with symbol argument + varargs
- [#1989](https://github.com/clj-kondo/clj-kondo/issues/1989): don't analyze location metadata coming from `:macroexpand hook` (performance optimization)

## 2023.01.20

Expand Down
8 changes: 6 additions & 2 deletions parser/clj_kondo/impl/rewrite_clj/node/coerce.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@
(defn- node-with-meta
[node value]
(if (instance? clojure.lang.IMeta value)
(let [mta (meta value)]
(let [mta (meta value)
;; if metadata contains other key than location key, we add it to :meta so it will be analyzed
other? (some #(not (contains? #{:row :end-row :col :end-col} %)) (keys mta))]
(if mta
(with-meta
(update node :meta lconj (coerce mta))
(if other?
(update node :meta lconj (coerce mta))
node)
mta)
node))
node))
Expand Down
2 changes: 0 additions & 2 deletions src/clj_kondo/impl/analyzer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2555,8 +2555,6 @@
(defn analyze-expression**
[{:keys [bindings lang] :as ctx}
{:keys [children] :as expr}]
;; (prn :expr expr)
;; (utils/where-am-i 20)
(when expr
(let [expr (if (or (not= :edn lang)
(:quoted ctx))
Expand Down

0 comments on commit 0f31dfd

Please sign in to comment.