Skip to content

Commit 3cd3b7a

Browse files
authored
Rollup merge of #90757 - GuillaumeGomez:search-index-performance, r=camelid
Remove unneeded FIXMEs comments in search index generation Original comment: > Instead of recreating a new `vec` for each arguments, we re-use the same. The impact on performance should be minor but worth a try. After testing it, we reached the conclusion that the code readability drop wasn't worth the almost unnoticeable performance improvement. r? ````@camelid````
2 parents 0576445 + 6b3695d commit 3cd3b7a

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/librustdoc/html/render/cache.rs

-4
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,9 @@ crate fn get_all_types<'tcx>(
398398
if arg.type_.is_self_type() {
399399
continue;
400400
}
401-
// FIXME: performance wise, it'd be much better to move `args` declaration outside of the
402-
// loop and replace this line with `args.clear()`.
403401
let mut args = Vec::new();
404402
get_real_types(generics, &arg.type_, tcx, 0, &mut args);
405403
if !args.is_empty() {
406-
// FIXME: once back to performance improvements, replace this line with:
407-
// `all_types.extend(args.drain(..));`.
408404
all_types.extend(args);
409405
} else {
410406
if let Some(kind) = arg.type_.def_id_no_primitives().map(|did| tcx.def_kind(did).into())

0 commit comments

Comments
 (0)