You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/rustc_ast_lowering/src/format.rs
+3
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,9 @@ fn expand_format_args<'hir>(
223
223
// in order, we can use a simple array instead of a `match` construction.
224
224
// However, if there's a yield point in any argument except the first one,
225
225
// we don't do this, because an ArgumentV1 cannot be kept across yield points.
226
+
//
227
+
// This is an optimization, speeding up compilation about 1-2% in some cases.
228
+
// See https://perf.rust-lang.org/compare.html?start=5dbee4d3a6728eb4530fb66c9775834438ecec74&end=e36affffe97378a0027b4bcfbb18d27356164ed0&stat=instructions:u
226
229
let use_simple_array = argmap.len() == arguments.len()
227
230
&& argmap.iter().enumerate().all(|(i,&(j, _))| i == j)
0 commit comments