Skip to content

Commit

Permalink
Initialize vector with capacity 128 to avoid reallocs (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
bisho authored Mar 4, 2024
1 parent 651aa6d commit 30c0126
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "meta-memcache-socket"
version = "0.1.1"
version = "0.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion src/impl_build_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn impl_build_cmd(
}

// Build the command
let mut buf: Vec<u8> = Vec::new();
let mut buf: Vec<u8> = Vec::with_capacity(128);

// Add CMD
buf.extend_from_slice(cmd);
Expand Down

0 comments on commit 30c0126

Please sign in to comment.