Skip to content

Commit 6d38743

Browse files
committed
Auto 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 f820d9d + 6b3695d commit 6d38743

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
@@ -408,13 +408,9 @@ crate fn get_all_types<'tcx>(
408408
if arg.type_.is_self_type() {
409409
continue;
410410
}
411-
// FIXME: performance wise, it'd be much better to move `args` declaration outside of the
412-
// loop and replace this line with `args.clear()`.
413411
let mut args = Vec::new();
414412
get_real_types(generics, &arg.type_, tcx, 0, &mut args, cache);
415413
if !args.is_empty() {
416-
// FIXME: once back to performance improvements, replace this line with:
417-
// `all_types.extend(args.drain(..));`.
418414
all_types.extend(args);
419415
} else {
420416
if let Some(kind) = arg.type_.def_id_no_primitives().map(|did| tcx.def_kind(did).into())

0 commit comments

Comments
 (0)