Skip to content

Commit

Permalink
Avoid capturing in regexes when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Nov 10, 2024
1 parent def26bb commit ef65682
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ubi/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ pub(crate) static ALL_ARCHES_RE: Lazy<Regex> = Lazy::new(|| {
x86_64_re(),
]
.iter()
.map(|r| format!("({})", r.as_str()))
.map(|r| format!("(?:{})", r.as_str()))
.join("|"),
)
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion ubi/src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub(crate) static ALL_OSES_RE: Lazy<Regex> = Lazy::new(|| {
windows_re(),
]
.iter()
.map(|r| format!("({})", r.as_str()))
.map(|r| format!("(?:{})", r.as_str()))
.join("|"),
)
.unwrap()
Expand Down

0 comments on commit ef65682

Please sign in to comment.