From fe98cbcae1e2d93d6ba85e73f00c0b432d8724e0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 24 Nov 2024 20:53:41 +0100 Subject: [PATCH] LibWeb: Don't copy HashMaps so dang much in WebCrypto --- Libraries/LibWeb/Crypto/SubtleCrypto.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/Crypto/SubtleCrypto.cpp b/Libraries/LibWeb/Crypto/SubtleCrypto.cpp index 856f7fdbb32..9f66a56095f 100644 --- a/Libraries/LibWeb/Crypto/SubtleCrypto.cpp +++ b/Libraries/LibWeb/Crypto/SubtleCrypto.cpp @@ -34,7 +34,7 @@ struct RegisteredAlgorithm { using SupportedAlgorithmsMap = HashMap>; static SupportedAlgorithmsMap& supported_algorithms_internal(); -static SupportedAlgorithmsMap supported_algorithms(); +static SupportedAlgorithmsMap const& supported_algorithms(); template static void define_an_algorithm(String op, String algorithm); @@ -77,7 +77,7 @@ WebIDL::ExceptionOr normalize_an_algorithm(JS:: // If alg is an object: // 1. Let registeredAlgorithms be the associative container stored at the op key of supportedAlgorithms. // NOTE: There should always be a container at the op key. - auto internal_object = supported_algorithms(); + auto const& internal_object = supported_algorithms(); auto maybe_registered_algorithms = internal_object.get(operation); auto registered_algorithms = maybe_registered_algorithms.value(); @@ -741,7 +741,7 @@ SupportedAlgorithmsMap& supported_algorithms_internal() } // https://w3c.github.io/webcrypto/#algorithm-normalization-internalS -SupportedAlgorithmsMap supported_algorithms() +SupportedAlgorithmsMap const& supported_algorithms() { auto& internal_object = supported_algorithms_internal();