electron/shell
trop[bot] d0658ccc98
perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46395)
* perf: avoid making an unnecessary copy of the vector

MimeTypesHandler::GetMIMETypeAllowlist() returns a const&, so we can
iterate that directly instead of making a temporary copy of it.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: move the call to ExtensionRegistry::Get() outside of the loop

Also, keep the previous behavior of not calling it at all if there
aren't any whitelisted extensions.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: avoid redundant map lookup

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: const correctness

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: cleanup

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 09:07:45 -05:00
..
app refactor: remove unused system header includes (#46042) 2025-03-15 00:33:33 -05:00
browser perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46395) 2025-04-01 09:07:45 -05:00
common refactor: use v8::String::Empty() when creating empty strings (#46372) 2025-03-31 08:56:53 -05:00
renderer perf: prefer absl::flat_hash_set over std::unordered_set (#46374) 2025-03-31 08:25:16 -05:00
services/node refactor: use private inheritance from mojo::MessageReceiver (#45993) 2025-03-12 23:19:17 -05:00
utility fix: broken OOP window.print() on macOS/Linux (#45259) 2025-01-20 10:37:35 -06:00