dhaumann closed this revision.
dhaumann added a comment.
Committed with
https://cgit.kde.org/ktexteditor.git/commit/?id=ac8f9f61a0d160a04fd46cb7f87b1509987892aa
REPOSITORY
R39 KTextEditor
REVISION DETAIL
https://phabricator.kde.org/D9211
To: dhaumann, mwolff, apol
Cc: ngraham, #framewor
dhaumann marked 2 inline comments as done.
REPOSITORY
R39 KTextEditor
BRANCH
AvoidAllocs (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D9211
To: dhaumann, mwolff, apol
Cc: ngraham, #frameworks, michaelh, kevinapavew, kmorwinski, demsking,
cullmann, sars, dhaumann
dhaumann marked 8 inline comments as done.
dhaumann added a comment.
Mark comments as done.
INLINE COMMENTS
> mwolff wrote in katedocument.cpp:109
> you want to return `std::distance(list.begin(), it)` here
Good catch!
REPOSITORY
R39 KTextEditor
BRANCH
AvoidAllocs (branched from master
dhaumann updated this revision to Diff 27963.
dhaumann added a comment.
- Add and use contains()
- Use QLaint1String
REPOSITORY
R39 KTextEditor
CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D9211?vs=23526&id=27963
BRANCH
AvoidAllocs (branched from master)
REVISION DETAIL
h
mwolff added a comment.
much better, but can be somewhat better still.
if people don't know the STL, they should learn it.
INLINE COMMENTS
> katedocument.cpp:109
> +auto it = std::find(list.begin(), list.end(), entry);
> +return it == list.end() ? -1 : std::distance(it, list.end(
dhaumann added a comment.
@mwolff I still would like to know from you whether you think this patch
makes thinks better: I need additional helper functions etc. just to use the
STL to avoid these allocs. Additional helper functions are added complexity,
since it's not standard Qt stuff that e
apol accepted this revision.
This revision is now accepted and ready to land.
REPOSITORY
R39 KTextEditor
BRANCH
AvoidAllocs (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D9211
To: dhaumann, mwolff, apol
Cc: ngraham, #frameworks, kevinapavew, demsking, cullmann, sars,
dhaumann created this revision.
dhaumann added a reviewer: mwolff.
Restricted Application added projects: Kate, Frameworks.
Restricted Application added a subscriber: Frameworks.
REVISION SUMMARY
I had to add a helper function to avoid messy
STL iterator code everywhere. Not an ideal solution,