rustdoc: remove unused parameter reversed
from onEach(Lazy)
This feature was added in edec5807ac
to support JavaScript-based toggles that were later replaced with
HTML `<details>`.
This commit is contained in:
parent
f16c81fa79
commit
6a0a89af80
1 changed files with 6 additions and 19 deletions
|
@ -51,22 +51,11 @@ function removeClass(elem, className) {
|
||||||
* Run a callback for every element of an Array.
|
* Run a callback for every element of an Array.
|
||||||
* @param {Array<?>} arr - The array to iterate over
|
* @param {Array<?>} arr - The array to iterate over
|
||||||
* @param {function(?)} func - The callback
|
* @param {function(?)} func - The callback
|
||||||
* @param {boolean} [reversed] - Whether to iterate in reverse
|
|
||||||
*/
|
*/
|
||||||
function onEach(arr, func, reversed) {
|
function onEach(arr, func) {
|
||||||
if (arr && arr.length > 0) {
|
for (const elem of arr) {
|
||||||
if (reversed) {
|
if (func(elem)) {
|
||||||
for (let i = arr.length - 1; i >= 0; --i) {
|
return true;
|
||||||
if (func(arr[i])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (const elem of arr) {
|
|
||||||
if (func(elem)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -80,14 +69,12 @@ function onEach(arr, func, reversed) {
|
||||||
* https://developer.mozilla.org/en-US/docs/Web/API/NodeList
|
* https://developer.mozilla.org/en-US/docs/Web/API/NodeList
|
||||||
* @param {NodeList<?>|HTMLCollection<?>} lazyArray - An array to iterate over
|
* @param {NodeList<?>|HTMLCollection<?>} lazyArray - An array to iterate over
|
||||||
* @param {function(?)} func - The callback
|
* @param {function(?)} func - The callback
|
||||||
* @param {boolean} [reversed] - Whether to iterate in reverse
|
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
function onEachLazy(lazyArray, func, reversed) {
|
function onEachLazy(lazyArray, func) {
|
||||||
return onEach(
|
return onEach(
|
||||||
Array.prototype.slice.call(lazyArray),
|
Array.prototype.slice.call(lazyArray),
|
||||||
func,
|
func);
|
||||||
reversed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLocalStorage(name, value) {
|
function updateLocalStorage(name, value) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue