diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2016-09-23 15:46:41 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2016-09-23 14:27:01 +0000 |
commit | d915b22db9a3e66a2faa045251f7df2146dd428e (patch) | |
tree | 726fc40b312c0e86c4a6469f064d7e3b9fcac78c /src/plugins/glsleditor | |
parent | 669d04a686418541f83a1936d4b278721ec986fe (diff) | |
download | qt-creator-d915b22db9a3e66a2faa045251f7df2146dd428e.tar.gz |
improve static initializers
Change-Id: I304fdd6627f01fc216c84930da607127c52409d9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/glsleditor')
-rw-r--r-- | src/plugins/glsleditor/glslhighlighter.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/plugins/glsleditor/glslhighlighter.cpp b/src/plugins/glsleditor/glslhighlighter.cpp index 122bb2e7ce..eed647e177 100644 --- a/src/plugins/glsleditor/glslhighlighter.cpp +++ b/src/plugins/glsleditor/glslhighlighter.cpp @@ -39,21 +39,20 @@ namespace Internal { GlslHighlighter::GlslHighlighter() { - static QVector<TextStyle> categories; - if (categories.isEmpty()) { - categories << C_NUMBER - << C_STRING - << C_TYPE - << C_KEYWORD - << C_OPERATOR - << C_PREPROCESSOR - << C_LABEL - << C_COMMENT - << C_DOXYGEN_COMMENT - << C_DOXYGEN_TAG - << C_VISUAL_WHITESPACE - << C_REMOVED_LINE; - } + static const QVector<TextStyle> categories({ + C_NUMBER, + C_STRING, + C_TYPE, + C_KEYWORD, + C_OPERATOR, + C_PREPROCESSOR, + C_LABEL, + C_COMMENT, + C_DOXYGEN_COMMENT, + C_DOXYGEN_TAG, + C_VISUAL_WHITESPACE, + C_REMOVED_LINE + }); setTextFormatCategories(categories); } |