Skip to content

Commit 037a29f

Browse files
authored
KCL: Remove another clone in recast (#7848)
Gives a 3% and 7% improvement on my Macbook to recaster benchmarks.
1 parent 719334d commit 037a29f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kcl-lib/src/unparser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ impl CallExpressionKw {
399399
}
400400

401401
let arg_list = self.recast_args(options, indentation_level, ctxt);
402-
let args = arg_list.clone().join(", ");
403402
let has_lots_of_args = arg_list.len() >= 4;
403+
let args = arg_list.join(", ");
404404
let some_arg_is_already_multiline = arg_list.len() > 1 && arg_list.iter().any(|arg| arg.contains('\n'));
405405
let multiline = has_lots_of_args || some_arg_is_already_multiline;
406406
if multiline {

0 commit comments

Comments
 (0)