diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-04-09 10:18:39 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-04-27 04:35:25 +0000 |
commit | 629422607f265865cec8a010de4a5c2ffd664603 (patch) | |
tree | 73dc58f0e6ac93a052ff3785b803282726c94bfc /src/corelib/tools/qlocale_p.h | |
parent | e63daaa2acd7d7f960ff11c3130deeded92af3cc (diff) |
QCompletionEngine: avoid a node allocation on lookup
In matchHint() and lookupCache(), instead of checking for the
existence of 'parent' in 'cache', a new entry was created, if
needed.
However, the remainders of the functions could only fail in
that case, so don't allocate an empty map node here at all.
Wherever something sensible is added to the cache, there will
have to be an insertion of the same node anyway, so there's
no point doing that work here.
Allows to mark these functions const.
Also passed the QString argument by const-reference instead
of by value.
Done-with: Anton Kudryavtsev <a.kudryavtsev@netris.ru>
Change-Id: Ia873f246869a68eecaef83ce4a6b6369187456be
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qlocale_p.h')
0 files changed, 0 insertions, 0 deletions