mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 05:31:25 -07:00
Replace QStringRef with QStringView
This commit is contained in:
parent
27baa55443
commit
399d3ad85a
26 changed files with 82 additions and 90 deletions
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue