QHttpServerRequestFilter: avoid double lookup in isRequestWithinRate()


The old code used find() followed by emplace() if not found. This
means a new entry required two lookups. Use the new
QHash::try_emplace() to do both find() and emplace() in one go.

Unfortunately, using the std-compliant try_emplace() would have
required a larger rewrite, as it returns a KeyValueIterator, while the
following code expects an old-style Qt QHash::iterator, so use the
non-standard tryEmplace().

Amends c43b2f7a84ca1141b4d7d323d8b6cac7c75aa7e5.

Pick-to: 6.10 6.9
Change-Id: I76ee9fac49f41c62d0b95c4c2f20ac6c42edd4cc
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
commit9c28c396cda50e6265575e7ac018607e1d85da2c
parentcc96264b62a24b3304c2946bfb216110dfdd44a1
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeTue, 24 Jun 2025 19:53:30 +0200