diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2024-08-26 13:37:56 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2024-08-27 02:41:55 +0200 |
| commit | cdc04b96dd8a69d0310e1474008b48128d050450 (patch) | |
| tree | d7f4e8d81de26ad3d786416ca3288b1f5883dcfd /src/opengl/qopengldebug.cpp | |
| parent | e6dab10c32b2d57e8f47e5c16827a3c1560f2e27 (diff) | |
QHash: re-SCARY-fy value() and key() methods
This reverts commit ba24125cbfdbe78b48e8000ee6030f0d81a86491.
The funImpl() functions were specifically designed to be sharable
between the fun(key) and fun(key, def) overloads. Making the return
statement a template argument turns one function into two, duplicating
the executable code. It doesn't even improve readability much, so
revert to returning pointers as a poor-man's optional<>.
This re-SCARY-fies the functions, also adapting the code of the
heterogeneous lookup additions that were introduced later.
An alternative would have been to use qxp::function_ref, but that
produces a lot of code itself, as the recent removal of it from QtTest
has shown, and it's not required, either. KISS applies: the old
return-by-pointer was the most simple implementation possible. There
is no need for a type-erasing function wrapper here.
Pick-to: 6.8
Change-Id: I8570ce5acd6d6e98321e4003919651cd97cad83e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/opengl/qopengldebug.cpp')
0 files changed, 0 insertions, 0 deletions
