I had to add a helper function to avoid messy
STL iterator code everywhere. Not an ideal solution,
but std::contains() simply still does not exist, yet :-)
Details
Details
make test
Diff Detail
Diff Detail
- Repository
- R39 KTextEditor
- Branch
- AvoidAllocs (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
@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 everyone typically knows out of the box. That's why I am asking :-) So I for one see benefits and drawbacks ;)
Comment Actions
much better, but can be somewhat better still.
if people don't know the STL, they should learn it.
src/document/katedocument.cpp | ||
---|---|---|
109 | you want to return std::distance(list.begin(), it) here | |
4538–4539 | here and below, these could now contain QLatin1String, reducing the size of the binary a bit | |
4575 | add a contains that does this check, also use it below | |
4669 | contains | |
4754–4755 | QLatin1String | |
4755 | contains | |
4760–4761 | QLatin1String | |
4761 | contains |