mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Merge pull request #10473 from Chocobo1/warning
Fix unsafe type narrowing (MSVC C4267 warning)
This commit is contained in:
commit
c7f89f55d0
1 changed files with 2 additions and 2 deletions
|
@ -173,7 +173,7 @@ namespace Utils
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
ComponentsArray res {{}};
|
ComponentsArray res {{}};
|
||||||
for (std::size_t i = 0; i < static_cast<std::size_t>(versionParts.size()); ++i) {
|
for (std::size_t i = 0; i < static_cast<std::size_t>(versionParts.size()); ++i) {
|
||||||
res[i] = static_cast<T>(versionParts[i].toInt(&ok));
|
res[i] = static_cast<T>(versionParts[static_cast<typename StringsList::size_type>(i)].toInt(&ok));
|
||||||
if (!ok)
|
if (!ok)
|
||||||
throw std::runtime_error("Can not parse version component");
|
throw std::runtime_error("Can not parse version component");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue