Skip to content

Commit 3f815e7

Browse files
authored
Rollup merge of rust-lang#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 c4e0b8b + 6b3695d commit 3f815e7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/librustdoc/html/render/cache.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,9 @@ crate fn get_all_types<'tcx>(
409409
if arg.type_.is_self_type() {
410410
continue;
411411
}
412-
// FIXME: performance wise, it'd be much better to move `args` declaration outside of the
413-
// loop and replace this line with `args.clear()`.
414412
let mut args = Vec::new();
415413
get_real_types(generics, &arg.type_, tcx, 0, &mut args, cache);
416414
if !args.is_empty() {
417-
// FIXME: once back to performance improvements, replace this line with:
418-
// `all_types.extend(args.drain(..));`.
419415
all_types.extend(args);
420416
} else {
421417
if let Some(kind) = arg.type_.def_id_no_primitives().map(|did| tcx.def_kind(did).into())

0 commit comments

Comments
 (0)