Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Optimized goog.dom.classlist.removeAll.

goog.partial is slow because it has to create the 'arguments' array at every call.

R=jeffschiller,gboyer
DELTA=3  (1 added, 0 deleted, 2 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=5804


git-svn-id: http://closure-library.googlecode.com/svn/trunk@2295 0b95b8e8-c90f-11de-9d4f-f947ee5921c8
  • Loading branch information...
commit ed85e0fe31fbdf1c6b421a6e96c683b6c7690c2f 1 parent 8bcb89f
pallosp@google.com authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 closure/goog/dom/classlist.js
5 closure/goog/dom/classlist.js
@@ -146,8 +146,9 @@ goog.dom.classlist.remove = goog.dom.classlist.NATIVE_DOM_TOKEN_LIST_ ?
146 146 */
147 147 goog.dom.classlist.removeAll = goog.dom.classlist.NATIVE_DOM_TOKEN_LIST_ ?
148 148 function(element, classesToRemove) {
149   - goog.array.forEach(classesToRemove,
150   - goog.partial(goog.dom.classlist.remove, element));
  149 + goog.array.forEach(classesToRemove, function(className) {
  150 + goog.dom.classlist.remove(element, className);
  151 + });
151 152 } :
152 153 function(element, classesToRemove) {
153 154 // Filter out those classes in classesToRemove.

0 comments on commit ed85e0f

Please sign in to comment.
Something went wrong with that request. Please try again.