GIT_SILENT
Details
- Reviewers
cullmann - Group Reviewers
Kate - Commits
- R39:a7212d561de1: Do not generate string list at runtime
Diff Detail
- Repository
- R39 KTextEditor
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Hmm, could we here now avoid the QStringList completely and just use a normal array with a range based for below?
(And thanks for all the quick review :) )
Okay, looks like. Was trying to focus on one thing at a time, but you will get an update in a minute :)
src/mode/katemodemanager.cpp | ||
---|---|---|
214 | I would even prefer: static const auto commonSuffixes = { ... }; This way it's an initializer_list and a pattern we use at other places in KTextEditor as well. But of course, your patch is correct as well! Runtime should be the same. |
src/mode/katemodemanager.cpp | ||
---|---|---|
214 | I saw you mentioned this elsewhere, but thought it was a typo. Never seen this before, so curious to leatn what advantage using an initializer list brings here. By the name, i would expect its prpose is usually one-time, to init a bigger structure. But by the code it seems here the list is kept, and simply always iterated over? |
src/mode/katemodemanager.cpp | ||
---|---|---|
214 | Because you can write auto and don't have to care. The initializee_list has bwgin(), end(), size(), all which the plain C array does not have: But I could imagine the generated code even looks the same? Maybe @mwolff knows. |