Cache length variables.

This commit is contained in:
XhmikosR 2018-09-25 12:54:09 +03:00
parent 5cce25d515
commit 82dd279656
2 changed files with 4 additions and 4 deletions

View File

@ -417,7 +417,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
var dependencies = this.getAttribute('data-dependencies') var dependencies = this.getAttribute('data-dependencies')
if (!dependencies) return if (!dependencies) return
dependencies = dependencies.split(',') dependencies = dependencies.split(',')
for (var i = 0; i < dependencies.length; i++) { for (var i = 0, len = dependencies.length; i < len; i++) {
var $dependency = $('[value="' + dependencies[i] + '"]') var $dependency = $('[value="' + dependencies[i] + '"]')
$dependency && $dependency.prop('checked', true) $dependency && $dependency.prop('checked', true)
} }
@ -428,7 +428,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
var dependents = this.getAttribute('data-dependents') var dependents = this.getAttribute('data-dependents')
if (!dependents) return if (!dependents) return
dependents = dependents.split(',') dependents = dependents.split(',')
for (var i = 0; i < dependents.length; i++) { for (var i = 0, len = dependents.length; i < len; i++) {
var $dependent = $('[value="' + dependents[i] + '"]') var $dependent = $('[value="' + dependents[i] + '"]')
$dependent && $dependent.prop('checked', false) $dependent && $dependent.prop('checked', false)
} }

View File

@ -42,7 +42,7 @@
'delegate', 'delegate',
'undelegate' 'undelegate'
] ]
for (var i = 0; i < eventAliases.length; i++) { for (var i = 0, len = eventAliases.length; i < len; i++) {
var eventAlias = eventAliases[i] var eventAlias = eventAliases[i]
$.fn[eventAlias] = function () { $.fn[eventAlias] = function () {
throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js') throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js')
@ -125,7 +125,7 @@
'test', 'test',
'throws' 'throws'
]; ];
for (var i = 0; i < methodNames.length; i++) { for (var i = 0, len = methodNames.length; i < len; i++) {
var methodName = methodNames[i]; var methodName = methodNames[i];
window[methodName] = undefined; window[methodName] = undefined;
} }