Avoid allocations for case-insensetive compare
This commit is contained in:
parent
4659cc50f2
commit
0c8febce9c
|
@ -782,7 +782,7 @@ void InnerWidget::paintPeerSearchResult(
|
|||
QRect tr(nameleft, st::dialogsPadding.y() + st::msgNameFont->height + st::dialogsSkip, namewidth, st::dialogsTextFont->height);
|
||||
p.setFont(st::dialogsTextFont);
|
||||
QString username = peer->userName();
|
||||
if (!active && username.toLower().startsWith(_peerSearchQuery)) {
|
||||
if (!active && username.startsWith(_peerSearchQuery, Qt::CaseInsensitive)) {
|
||||
auto first = '@' + username.mid(0, _peerSearchQuery.size());
|
||||
auto second = username.mid(_peerSearchQuery.size());
|
||||
auto w = st::dialogsTextFont->width(first);
|
||||
|
|
|
@ -465,7 +465,7 @@ std::optional<bool> IsDarkMode() {
|
|||
|
||||
if (!themeName.has_value()) {
|
||||
return std::nullopt;
|
||||
} else if (themeName->toLower().contains(qsl("-dark"))) {
|
||||
} else if (themeName->contains(qsl("-dark"), Qt::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue