Reduce code bloat a bit
Especially the emoji array shrinks a lot with this, but adds a few extra relocations on startup. But it removes a lot of exception handling code at runtime, which is nice and possibly this is still faster.
This commit is contained in:
parent
20740c9976
commit
920409e914
8 changed files with 11340 additions and 11297 deletions
|
|
@ -15,11 +15,11 @@ class Emoji(object):
|
|||
def generate_qml_list(**kwargs):
|
||||
entrycount = sum([len(c[1]) for c in kwargs.items()])
|
||||
tmpl = Template('''
|
||||
const std::array<Emoji, {{ entrycount }} > emoji::Provider::emoji = {
|
||||
constexpr std::array<Emoji, {{ entrycount }} > emoji::Provider::emoji = {
|
||||
{%- for c in kwargs.items() %}
|
||||
// {{ c[0].capitalize() }}
|
||||
{%- for e in c[1] %}
|
||||
Emoji{QStringLiteral(u"{{ e.code }}"), QStringLiteral(u"{{ e.shortname }}"), QStringLiteral(u"{{ e.unicodename }}"), emoji::Emoji::Category::{{ c[0].capitalize() }}},
|
||||
Emoji{null_literal(u"{{ e.code }}"), null_literal(u"{{ e.shortname }}"), null_literal(u"{{ e.unicodename }}"), emoji::Emoji::Category::{{ c[0].capitalize() }}},
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue