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.
This commit is contained in:
PeterN
2019-03-02 08:06:02 +00:00
committed by GitHub
parent 7ecfae8f7f
commit 63fe6c6598
2 changed files with 3 additions and 2 deletions

View File

@@ -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) {}