From cb33af755a775770d67eb4645e287a7170458a58 Mon Sep 17 00:00:00 2001 From: Nic McPhee Date: Fri, 25 Feb 2022 16:29:02 -0600 Subject: [PATCH] Remove unnecessary use of `read-string` in Middle Character For some reason `read-string` was being called to parse a string to a string in Middle Character, along with a totally unnecessary try/catch block. This cleans that up. It looks like most if not all of the PSB2 problems have this issue and we'll need to go through and update all of those to not use `read-string`. --- src/propeller/problems/PSB2/middle_character.cljc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/propeller/problems/PSB2/middle_character.cljc b/src/propeller/problems/PSB2/middle_character.cljc index f9a4b18..ee2378b 100644 --- a/src/propeller/problems/PSB2/middle_character.cljc +++ b/src/propeller/problems/PSB2/middle_character.cljc @@ -48,9 +48,9 @@ :string)) inputs) parsed-outputs (map (fn [output] - (try (read-string output) - #?(:clj (catch Exception e 1000.0) - :cljs (catch js/Error. e 1000.0)))) + (if (= output :no-stack-item) + 1000.0 + output)) outputs) errors (map (fn [correct-output output] (if (= output :no-stack-item)