Skip to content

Commit 85882b3

Browse files
committed
Compile the filter regex only once when filtering jobs
Previously it was compiled once for each job being filtered. Suggested-by: JustAnotherArchivist Fixes: commit 990b70d
1 parent 203d40a commit 85882b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dashboard/assets/scripts/dashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,14 +621,14 @@ class JobsRenderer {
621621
}
622622

623623
applyFilter() {
624-
const query = this.filterBox.value;
624+
const query = RegExp(this.filterBox.value);
625625
let matches = 0;
626626
const matchedWindows = [];
627627
const unmatchedWindows = [];
628628
this.firstFilterMatch = null;
629629
for (const job of this.jobs.sorted) {
630630
const w = this.renderInfo[job.ident].logWindow;
631-
if (!RegExp(query).test(job.url)) {
631+
if (!query.test(job.url)) {
632632
w.classList.add("log-window-hidden");
633633

634634
unmatchedWindows.push(w);

0 commit comments

Comments
 (0)