Replace QStringRef with QStringView

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-03-01 09:40:30 +03:00
parent 27baa55443
commit 399d3ad85a
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
26 changed files with 82 additions and 90 deletions

View file

@ -43,7 +43,7 @@
// to send numbers instead of strings with suffixes
QString Utils::String::fromDouble(const double n, const int precision)
{
/* HACK because QString rounds up. Eg QString::number(0.999*100.0, 'f' ,1) == 99.9
/* HACK because QString rounds up. Eg QString::number(0.999*100.0, 'f', 1) == 99.9
** but QString::number(0.9999*100.0, 'f' ,1) == 100.0 The problem manifests when
** the number has more digits after the decimal than we want AND the digit after
** our 'wanted' is >= 5. In this case our last digit gets rounded up. So for each
@ -99,7 +99,7 @@ std::optional<double> Utils::String::parseDouble(const QString &string)
return std::nullopt;
}
QString Utils::String::join(const QVector<QStringRef> &strings, const QString &separator)
QString Utils::String::join(const QList<QStringView> &strings, const QStringView separator)
{
if (strings.empty())
return {};