mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Replace QString::mid with base::StringViewMid where QStringView is accepted
This commit is contained in:
@@ -235,7 +235,7 @@ ExpireDateValidationResult ValidateExpireDate(
|
||||
return { ValidationState::Incomplete };
|
||||
}
|
||||
const auto normalized = (sanitized[0] > '1' ? "0" : "") + sanitized;
|
||||
const auto month = normalized.mid(0, 2).toInt();
|
||||
const auto month = base::StringViewMid(normalized, 0, 2).toInt();
|
||||
if (month < 1 || month > 12) {
|
||||
return { ValidationState::Invalid };
|
||||
} else if (normalized.size() < 4) {
|
||||
@@ -243,7 +243,7 @@ ExpireDateValidationResult ValidateExpireDate(
|
||||
} else if (normalized.size() > 4) {
|
||||
return { ValidationState::Invalid };
|
||||
}
|
||||
const auto year = 2000 + normalized.mid(2).toInt();
|
||||
const auto year = 2000 + base::StringViewMid(normalized, 2).toInt();
|
||||
|
||||
const auto thresholdDate = overrideExpireDateThreshold.value_or(
|
||||
QDate::currentDate());
|
||||
|
Reference in New Issue
Block a user