From fdca68fe38decd293f8f10d58157ac4910d3ad11 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Mon, 27 Jan 2014 11:21:32 +0100 Subject: [PATCH] Update $.rmAll according to a new benchmark. --- lib/$.coffee | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/$.coffee b/lib/$.coffee index 3b39b3b30..78e8f54f7 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -102,10 +102,8 @@ $.hasClass = (el, className) -> $.rm = (el) -> el.remove() $.rmAll = (root) -> - # jsperf.com/emptify-element - for node in [root.childNodes...] - node.remove() - return + # https://gist.github.com/MayhemYDG/8646194 + root.textContent = null $.tn = (s) -> d.createTextNode s $.nodes = (nodes) ->