Skip to content

Commit

Permalink
Refactor / performance: consolidate non-emptiness check with stack po…
Browse files Browse the repository at this point in the history
…p operation
  • Loading branch information
jayaddison committed Nov 6, 2024
1 parent b2de18a commit 6aa4f7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx/themes/basic/static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ const Search = {
setIndex: (index) => {
const stack = [index];
const isObject = x => x instanceof Object;
while (stack.length) {
const obj = stack.pop();
let obj;
while (obj = stack.pop()) {
if (Array.isArray(obj)) {
stack.push(...obj.filter(isObject));
} else {
Expand Down

0 comments on commit 6aa4f7f

Please sign in to comment.