Update $.rmAll according to a new benchmark.

This commit is contained in:
Mayhem 2014-01-27 11:21:32 +01:00
parent 06e5ce4ef6
commit fdca68fe38

View File

@ -102,10 +102,8 @@ $.hasClass = (el, className) ->
$.rm = (el) -> $.rm = (el) ->
el.remove() el.remove()
$.rmAll = (root) -> $.rmAll = (root) ->
# jsperf.com/emptify-element # https://gist.github.com/MayhemYDG/8646194
for node in [root.childNodes...] root.textContent = null
node.remove()
return
$.tn = (s) -> $.tn = (s) ->
d.createTextNode s d.createTextNode s
$.nodes = (nodes) -> $.nodes = (nodes) ->