diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-04-28 07:12:43 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-05-03 20:13:25 +0000 |
commit | 87e90a265f6b07b489ea249cc00b46f13e879d83 (patch) | |
tree | b252c44f77aab5ff6d9e70ef87ef8e41f82c2178 /src/corelib/tools/qmap.qdoc | |
parent | 5a3ac484dbcc64c8ee7a57854fcdde6b4b067aaa (diff) |
QVarLengthArray: simplify / optimize assign(It, It)
After many failed attempts at addressing my dissatisfaction with the
if (n) checks, I finally realized that the problem is the
while (first != last && end != end())
loop, which, when exited, gives no indication as to _why_ it was
exited. Any attempt to re-construct the exit condition must needs
re-check something that should be known already.
To fix, then, use a while (true) loop and react on first == last and
dst == end() separately.
As a drive-by, cache end().
Task-number: QTBUG-106200
Change-Id: Ic873774451df4102163e6e65d93c35e5dcbbb037
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qmap.qdoc')
0 files changed, 0 insertions, 0 deletions