Verified Commit b1186218 authored by Camil Staps's avatar Camil Staps 🚀

Remove null check from == instance of JSONNode

parent ec5d777c
Pipeline #29661 passed with stage
in 2 minutes and 52 seconds
...@@ -760,11 +760,10 @@ where ...@@ -760,11 +760,10 @@ where
// NB: put the most frequently encountered constructors at the top for performance // NB: put the most frequently encountered constructors at the top for performance
== (JSONObject xs) y = case y of == (JSONObject xs) y = case y of
JSONObject ys JSONObject ys
-> sortBy cmpFst (filter (notNull o snd) xs) == sortBy cmpFst (filter (notNull o snd) ys) -> sortBy cmpFst xs == sortBy cmpFst ys
-> False -> False
where where
cmpFst = (<) `on` fst cmpFst = (<) `on` fst
notNull x = not (x=:JSONNull)
== (JSONArray x) y = case y of JSONArray y -> x==y; _ -> False == (JSONArray x) y = case y of JSONArray y -> x==y; _ -> False
== (JSONString x) y = case y of JSONString y -> x==y; _ -> False == (JSONString x) y = case y of JSONString y -> x==y; _ -> False
== (JSONInt x) y = case y of == (JSONInt x) y = case y of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment