diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-27 16:56:12 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-28 21:53:17 +0200 |
commit | 2596a8a55ce3c9532701c2cf1f353b93df4bd893 (patch) | |
tree | a5fb4546a5bac5cd560abb98c8a01fe157839d7a /src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp | |
parent | b2587f9ea40c89e8d7c21bfeb34ccdb67c804c81 (diff) |
QSharedNetworkSessionManager: clean up
Under no circumstance must Qt code define a non-public qHash()
overload of a public Qt type. If you can't provide a public qHash()
for the type, you can't use QHash. Period. This is because if we don't
provide a qHash() function, the user will have to provide one, and
then we have an ODR violation, iow: UB.
So, port away from QHash and qHash and use std::unordered_map, which
allows to pass a custom hash function - just what we needed.
Also fix other issues of the code:
- Use a function object as the deleter of the QSharedPointer, to allow
inlining the function call.
- Avoid double lookup in case of a cache miss.
- Don't use direct initialization syntax for pointer variables. That's
just ... weird.
Change-Id: Ica8bff728c1bd1cbb2fb43aa03a99bcb7ac2f7cc
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp')
0 files changed, 0 insertions, 0 deletions