Skip to content

Commit 4fe3e6b

Browse files
committed
be lazy when updating the ctx.filter property
1 parent 98b4bac commit 4fe3e6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/context/api.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,9 @@ pub fn set_filter(mut cx: FunctionContext) -> JsResult<JsUndefined> {
10561056
let mut this = this.borrow_mut();
10571057
if !cx.argument::<JsValue>(1)?.is_a::<JsNull, _>(&mut cx) {
10581058
let (filter_text, specs) = filter_arg(&mut cx, 1)?;
1059-
this.state.filter = Filter::new(&filter_text, &specs);
1059+
if filter_text != this.state.filter.to_string() {
1060+
this.state.filter = Filter::new(&filter_text, &specs);
1061+
}
10601062
}
10611063
Ok(cx.undefined())
10621064
}

0 commit comments

Comments
 (0)