summaryrefslogtreecommitdiff
path: root/src/gfx_layout.h
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-03-02 08:06:02 +0000
committerGitHub <noreply@github.com>2019-03-02 08:06:02 +0000
commit63fe6c65983a4cf2eba4995d03abd7e8a39c4a43 (patch)
tree7e96914c221dc953e127a2c839692d049f25d84a /src/gfx_layout.h
parent7ecfae8f7f42906065d8861d424271c1a412ff12 (diff)
downloadopenttd-63fe6c65983a4cf2eba4995d03abd7e8a39c4a43.tar.xz
Codechange: Make std::stack use std::vector container in string formatting/drawing. (#7305)
This is a very minor performance increase which can add up during operations such as sorting. Performance impact my be platform/compiler dependent.
Diffstat (limited to 'src/gfx_layout.h')
-rw-r--r--src/gfx_layout.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gfx_layout.h b/src/gfx_layout.h
index f6fc3b5c7..94cbac073 100644
--- a/src/gfx_layout.h
+++ b/src/gfx_layout.h
@@ -19,6 +19,7 @@
#include <map>
#include <string>
#include <stack>
+#include <vector>
#ifdef WITH_ICU_LAYOUT
#include "layout/ParagraphLayout.h"
@@ -35,7 +36,7 @@ struct FontState {
FontSize fontsize; ///< Current font size.
TextColour cur_colour; ///< Current text colour.
- std::stack<TextColour> colour_stack; ///< Stack of colours to assist with colour switching.
+ std::stack<TextColour, std::vector<TextColour>> colour_stack; ///< Stack of colours to assist with colour switching.
FontState() : fontsize(FS_END), cur_colour(TC_INVALID) {}
FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour) {}