D23625: Use QString::count(QChar) over QString::split().length() - 1

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Mon Sep 2 13:04:37 BST 2019

kossebau added inline comments.


> kossebau wrote in normalvimode.cpp:3844
> Ah, no, textLines.last().length() needs the string section, so just a plain count would not be enough, only if combining with a QString::section call later, I now remember.
> And some other patch simply turned this into splitRef, so just one alloc here currently.
> So rather something where I messed up during patch juggling.
> Perhaps still can be ยต-optimized with using lastindexof instead :)

Given we talked about it and my brain has created an item, D23674 <https://phabricator.kde.org/D23674> is to get rid of it again :)

  R39 KTextEditor


To: kossebau, #kate, cullmann
Cc: apol, cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190902/547024db/attachment.html>

More information about the KWrite-Devel mailing list