From 349dd71ce91ae055f299f3b2b3e627f0f0bfecec Mon Sep 17 00:00:00 2001 From: gered Date: Mon, 3 Jan 2022 18:13:03 -0500 Subject: [PATCH] simplify i think this weird assoc was a leftover artifact from the old event-fn stuff that i removed already? either way, performing an assoc here is entirely useless so lets get rid of it --- src/aging_session/core.clj | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/aging_session/core.clj b/src/aging_session/core.clj index f3d6cf4..40b4757 100644 --- a/src/aging_session/core.clj +++ b/src/aging_session/core.clj @@ -40,10 +40,8 @@ (defn- sweep-entry "'Sweep' a single entry, removing it from the session map if its lifetime has exceeded the given ttl." [session-map ttl key] - (if-let [existing-entry (get session-map key)] - (if-not (entry-expired? ttl existing-entry) - (assoc session-map key existing-entry) - (dissoc session-map key)) + (if (entry-expired? ttl (get session-map key)) + (dissoc session-map key) session-map)) (defn- process-read-entry