mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(transformer/class-properties): prefer contains to intersects for bitflags (#7747)
Tiny refactor. `contains` is clearer than `intersects`, and they produce equivalent assembly when argument is a single flag value, and statically knowable. https://godbolt.org/z/bTdfbv3f8
This commit is contained in:
parent
463fc5f2de
commit
7e0f7eb67b
1 changed files with 1 additions and 1 deletions
|
|
@ -754,7 +754,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
|
|||
// Test for it in first pass over class elements, and avoid temp vars where possible.
|
||||
match ctx.symbols().get_reference(ident.reference_id()).symbol_id() {
|
||||
Some(symbol_id) => {
|
||||
ctx.symbols().get_flags(symbol_id).intersects(SymbolFlags::ConstVariable)
|
||||
ctx.symbols().get_flags(symbol_id).contains(SymbolFlags::ConstVariable)
|
||||
|| ctx
|
||||
.symbols()
|
||||
.get_resolved_references(symbol_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue