Use split and join instead of substr

Bug #1285120 reported by Anthony Dillon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Video Player
New
Medium
Karl Williams

Bug Description

I would suggest use split and join instead of substr in the toggleClass and removeClass function for speed.

- classString = classString.substr(0, nameIndex) + classString.substr(nameIndex+className.length);
+ classString = classString.split(className).join('');

Do not need the nameIndex variable then as the indexOf is only referenced once. So can move into the if conditional statement.

Changed in canonical-video-player:
importance: Undecided → Medium
assignee: nobody → Karl Williams (deadlight)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.