diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-03-29 22:06:34 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-03-30 15:08:11 +0000 |
commit | 0c8b5446d42b27b601ff369a8f93c4875feba2a5 (patch) | |
tree | d63b825a88fc1776446de70c23112f17925c651c /mkspecs | |
parent | 4fd5273f6144f25d675c733e83c3137ee3921aef (diff) |
Port QResourceRoot::mappingRootSubdir() to QStringSplitter
The code here performs a std::mismatch() on the normalized parts of
'root' and 'path', returning whether 'path' is a prefix of 'root'. If
'path' is a proper prefix of 'root', returns the first 'root' part
after 'path', in '*match'.
Instead of using QString::splitRef(), perform the splitting as we go,
using this class' own tool, QStringSplitter.
The goal here is to avoid the heap allocation caused by the QVector
return of splitRef(), of course. But even though using QStringSplitter
means the splitting is now purely inline, text size in optimized GCC 7
Linux AMD64 builds increases by only 24B.
Change-Id: I396cc6a30306940220c9e783c31506e6ac17b784
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'mkspecs')
0 files changed, 0 insertions, 0 deletions