Skip to content

Commit

Permalink
validate & py: replace clone with take in hot loop to minimize al…
Browse files Browse the repository at this point in the history
…locations
  • Loading branch information
jqnatividad committed Mar 27, 2024
1 parent 5b8d1c7 commit 8402d3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/python.rs
Expand Up @@ -256,7 +256,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
match rdr.read_record(&mut batch_record) {
Ok(has_data) => {
if has_data {
batch.push(batch_record.clone());
batch.push(std::mem::take(&mut batch_record));
} else {
// nothing else to add to batch
break;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/validate.rs
Expand Up @@ -487,7 +487,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
if flag_trim {
record.trim();
}
batch.push(record.clone());
batch.push(std::mem::take(&mut record));
} else {
// nothing else to add to batch
break;
Expand Down

0 comments on commit 8402d3a

Please sign in to comment.