From fa9b2130f43547be7e4698b8d95a23155c5d3ee1 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Fri, 26 Jan 2024 13:52:47 -0500 Subject: Use QStringLiteral in some places This should provide a light performance improvement as the QString is built at compile time, with the generated data being stored in the read-only segment of the built object file. --- src/activitypub/apquestion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/activitypub/apquestion.cpp') diff --git a/src/activitypub/apquestion.cpp b/src/activitypub/apquestion.cpp index 9cdffd0..3796174 100644 --- a/src/activitypub/apquestion.cpp +++ b/src/activitypub/apquestion.cpp @@ -16,7 +16,7 @@ APQuestion::APQuestion(APObjectFields fields) : APPost(fields) { QString APQuestion::get_html_render(HtmlRenderDetails render_info) { QString html(APPost::get_html_render(render_info)); - html.append(get_html_template("appoll")); + html.append(get_html_template(QStringLiteral("appoll"))); if (end_time.isValid()) { html.replace("{{end-time}}", render_info.locale->toString( @@ -39,7 +39,7 @@ QString APQuestion::get_html_poll_options(HtmlRenderDetails render_info) { QString full; for (PollOption option : options) { - QString html(get_html_template("appoll_item")); + QString html(get_html_template(QStringLiteral("appoll_item"))); html.replace("{{name}}", option.name); html.replace("{{votes}}", render_info.locale->toString(option.votes)); html.replace("{{votes-percent}}", render_info.locale->toString((int)((float)option.votes/(float)total_votes * 100))); -- cgit v1.2.3-54-g00ecf