perf(es/helpers): Improve fast-path for helper detection (#6502)

This commit is contained in:
HeYunfei 2022-11-24 16:44:26 +08:00 committed by GitHub
parent 75c4d22bb6
commit b3b5526be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,15 +170,12 @@ macro_rules! define_helpers {
impl InjectHelpers {
fn is_helper_used(&self) -> bool{
let mut value = false;
HELPERS.with(|helpers|{
$(
value |= helpers.inner.$name.load(Ordering::Relaxed);
false $(
|| helpers.inner.$name.load(Ordering::Relaxed)
)*
});
value
})
}
fn build_helpers(&self) -> Vec<Stmt> {