Change push_back to emplace_back in emoji_config.

Perhaps that way GCC won't give a warning on variable count inside
one method Ui::Emoji::Init() in Release builds.
This commit is contained in:
John Preston 2017-03-22 12:24:53 +03:00
parent 6601a00eea
commit 7fcc5d649c
3 changed files with 2180 additions and 2178 deletions

View File

@ -363,7 +363,7 @@ void Init() {\n\
auto coloredCount = 0;
for (auto &item : data_.list) {
source_->stream() << "\
Items.push_back({ " << computeId(item.id) << ", " << column << ", " << row << ", " << (item.postfixed ? "true" : "false") << ", " << (item.variated ? "true" : "false") << ", " << (item.colored ? "&Items[" + QString::number(variated) + "]" : "nullptr") << " });\n";
Items.emplace_back(" << computeId(item.id) << ", " << column << ", " << row << ", " << (item.postfixed ? "true" : "false") << ", " << (item.variated ? "true" : "false") << ", " << (item.colored ? "&Items[" + QString::number(variated) + "]" : "nullptr") << ", One::CreationTag());\n";
if (coloredCount > 0 && (item.variated || !item.colored)) {
if (!colorsCount_) {
colorsCount_ = coloredCount;

File diff suppressed because it is too large Load Diff

View File

@ -53,8 +53,20 @@ void Init();
constexpr auto kPostfix = static_cast<ushort>(0xFE0F);
class One {
struct CreationTag {
};
public:
One(One &&other) = default;
One(const QString &id, uint16 x, uint16 y, bool hasPostfix, bool colorizable, EmojiPtr original, CreationTag)
: _id(id)
, _x(x)
, _y(y)
, _hasPostfix(hasPostfix)
, _colorizable(colorizable)
, _original(original) {
Expects(!_colorizable || !colored());
}
QString id() const {
return _id;
@ -97,16 +109,6 @@ public:
}
private:
One(const QString &id, uint16 x, uint16 y, bool hasPostfix, bool colorizable, EmojiPtr original)
: _id(id)
, _x(x)
, _y(y)
, _hasPostfix(hasPostfix)
, _colorizable(colorizable)
, _original(original) {
t_assert(!_colorizable || !colored());
}
const QString _id;
const uint16 _x = 0;
const uint16 _y = 0;