From 3b491ec38e802c5b3a23e880d660cdb2c4267145 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Sat, 16 Aug 2014 16:52:34 -0400 Subject: [PATCH] simplify check as per suggestion in #206 --- mithril.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index baff05a8..2403213a 100644 --- a/mithril.js +++ b/mithril.js @@ -44,11 +44,11 @@ Mithril = m = new function app(window, undefined) { //there's logic that relies on the assumption that null and undefined data are equivalent to empty strings //- this prevents lifecycle surprises from procedural helpers that mix implicit and explicit return statements //- it simplifies diffing code - if (data === undefined || data === null) data = "" + if (data == null) data = "" if (data.subtree === "retain") return cached var cachedType = type.call(cached), dataType = type.call(data) - if (cached === undefined || cached === null || cachedType != dataType) { + if (cached == null || cachedType != dataType) { if (cached !== null && cached !== undefined) { if (parentCache && parentCache.nodes) { var offset = index - parentIndex