mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 07:21:02 -04:00
remove unneccesary array length checks
This commit is contained in:
parent
df781bec00
commit
8ece85127a
1 changed files with 10 additions and 15 deletions
|
@ -598,12 +598,9 @@ class RecipeWaiter {
|
||||||
clearAllSelectedClasses() {
|
clearAllSelectedClasses() {
|
||||||
const list = document.querySelectorAll(".operation.selected");
|
const list = document.querySelectorAll(".operation.selected");
|
||||||
|
|
||||||
// check if any operations are selected at all to prevent errors
|
list.forEach((item) => {
|
||||||
if (list.length) {
|
item.classList.remove("selected");
|
||||||
list.forEach((item) => {
|
});
|
||||||
item.classList.remove("selected");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -642,17 +639,15 @@ class RecipeWaiter {
|
||||||
|
|
||||||
this.clearAllSelectedClasses();
|
this.clearAllSelectedClasses();
|
||||||
|
|
||||||
if (recipeList.length) {
|
recipeList.forEach((ingredient) => {
|
||||||
recipeList.forEach((ingredient) => {
|
const ingredientName = ingredient.getAttribute("data-name");
|
||||||
const ingredientName = ingredient.getAttribute("data-name");
|
|
||||||
|
|
||||||
operations.forEach((operation) => {
|
operations.forEach((operation) => {
|
||||||
if (ingredientName === operation.getAttribute("data-name")) {
|
if (ingredientName === operation.getAttribute("data-name")) {
|
||||||
this.addSelectedClass(ingredientName);
|
this.addSelectedClass(ingredientName);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue