Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't run 200-entry quadratic-time insertion sorts at compile time
MakeFixedFlatMap runs a compile-time insertion sort. There were a couple of very large ones in print_media_l10n.cc. When base::StringPiece is switched to std::string_view, they blow through Clang's constexpr evaluation limit. Probably they were already near the edge, and std::string_view has more steps over base::StringPiece, by constexpr's counting, and that pushed this over the limit. Add a variant of MakeFixedFlatMap where the input is required to be (and checked to be) pre-sorted. Bug: 691162 Change-Id: I913532cc8fc0d7beadff07bf7ba17aba5420530a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4296340 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: David Benjamin <davidben@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/main@{#1111651}
- Loading branch information