Replace .at() with [] to dereference QStringView
Trivial readability tweak. Change-Id: Ife9249a3b7c08cef4a6359f6cac43ea7bfcded23 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
21d4e3a69d
commit
6616823fb7
@ -1545,8 +1545,8 @@ QDate QDate::fromString(QStringView string, Qt::DateFormat format)
|
||||
}
|
||||
case Qt::ISODate:
|
||||
// Semi-strict parsing, must be long enough and have punctuators as separators
|
||||
if (string.size() >= 10 && string.at(4).isPunct() && string.at(7).isPunct()
|
||||
&& (string.size() == 10 || !string.at(10).isDigit())) {
|
||||
if (string.size() >= 10 && string[4].isPunct() && string[7].isPunct()
|
||||
&& (string.size() == 10 || !string[10].isDigit())) {
|
||||
const ParsedInt year = readInt(string.first(4));
|
||||
const ParsedInt month = readInt(string.sliced(5, 2));
|
||||
const ParsedInt day = readInt(string.sliced(8, 2));
|
||||
|
Loading…
x
Reference in New Issue
Block a user