Skip to content

Commit

Permalink
Initialise a line to the original length of the line to reduce alloca…
Browse files Browse the repository at this point in the history
…tions.
  • Loading branch information
sciguyryan committed Feb 4, 2025
1 parent 1c97c9f commit 28f2e9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redox-core/src/parsing/asm_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl<'a> AsmParser<'a> {

let mut in_quoted_string = false;
let mut escaped_args = vec![];
let mut buffer = String::new();
let mut buffer = String::with_capacity(graphemes.len());
for (i, g) in graphemes.iter().enumerate() {
let is_escaped = i > 0 && graphemes[i - 1] == "\\";

Expand Down

0 comments on commit 28f2e9f

Please sign in to comment.