Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 with 3 additions and 2 deletions.
  1. +3 −2 closure/goog/dom/classlist.js
5 closure/goog/dom/classlist.js
View
@@ -146,8 +146,9 @@ goog.dom.classlist.remove = goog.dom.classlist.NATIVE_DOM_TOKEN_LIST_ ?
*/
goog.dom.classlist.removeAll = goog.dom.classlist.NATIVE_DOM_TOKEN_LIST_ ?
function(element, classesToRemove) {
- goog.array.forEach(classesToRemove,
- goog.partial(goog.dom.classlist.remove, element));
+ goog.array.forEach(classesToRemove, function(className) {
+ goog.dom.classlist.remove(element, className);
+ });
} :
function(element, classesToRemove) {
// Filter out those classes in classesToRemove.
Please sign in to comment.
Something went wrong with that request. Please try again.