From e9bf3624b7c661c4eb795a0dd7dee09c09e62642 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 2 Oct 2020 11:45:23 +0200 Subject: [PATCH] :sparkles: Review changes --- frontend/src/app/main/ui/workspace/snap_distances.cljs | 8 ++++---- frontend/src/app/main/ui/workspace/snap_points.cljs | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/snap_distances.cljs b/frontend/src/app/main/ui/workspace/snap_distances.cljs index 4b2decbc56..9a0c4d241a 100644 --- a/frontend/src/app/main/ui/workspace/snap_distances.cljs +++ b/frontend/src/app/main/ui/workspace/snap_distances.cljs @@ -198,10 +198,10 @@ show-distance? (fn [dist] (let [distances-to-show - (->> (d/concat (mapv first distance-coincidences) - (filterv #(check-in-set % lt-distances) gt-distances) - (filterv #(check-in-set % gt-distances) lt-distances)) - (into #{}))] + (->> (d/concat #{} + (map first distance-coincidences) + (filter #(check-in-set % lt-distances) gt-distances) + (filter #(check-in-set % gt-distances) lt-distances)))] (check-in-set dist distances-to-show))) ;; These are the segments whose distance will be displayed diff --git a/frontend/src/app/main/ui/workspace/snap_points.cljs b/frontend/src/app/main/ui/workspace/snap_points.cljs index 594c81401f..addf0094d7 100644 --- a/frontend/src/app/main/ui/workspace/snap_points.cljs +++ b/frontend/src/app/main/ui/workspace/snap_points.cljs @@ -110,9 +110,7 @@ ;; We use sets to store points/lines so there are no points/lines repeated ;; can cause problems with react keys - snap-points (->> @state - (mapcat add-point-to-snaps) - (into #{})) + snap-points (into #{} (mapcat add-point-to-snaps) @state) snap-lines (into (process-snap-lines @state :x) (process-snap-lines @state :y))]