Skip to content

Commit e561094

Browse files
Copilotcamc314
andcommitted
Address review feedback: simplify modifier handling
Remove unnecessary empty check and continue statement. The check for at_modifier() on line 322 ensures modifiers is never empty when we reach the Modifiers::new() call. Co-authored-by: camc314 <[email protected]>
1 parent 61c94ea commit e561094

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

crates/oxc_parser/src/modifiers.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,18 +332,12 @@ impl<'a> ParserImpl<'a> {
332332
let modifier = self.modifier(kind, self.end_span(span));
333333
if modifier.kind == ModifierKind::Export {
334334
self.error(diagnostics::modifier_already_seen(&modifier));
335-
// Don't add the duplicate export modifier to the list
336-
continue;
337335
}
338336
self.check_for_duplicate_modifiers(flags, &modifier);
339337
flags.set(modifier_flags, true);
340338
modifiers.push(modifier);
341339
}
342-
if modifiers.is_empty() {
343-
Modifiers::empty()
344-
} else {
345-
Modifiers::new(Some(modifiers), flags)
346-
}
340+
Modifiers::new(Some(modifiers), flags)
347341
}
348342

349343
fn at_modifier(&mut self) -> bool {

0 commit comments

Comments
 (0)