mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Avoid std::from_chars for now
This commit is contained in:
parent
51a559ab4a
commit
2838061f10
1 changed files with 2 additions and 4 deletions
|
@ -2,7 +2,6 @@
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <charconv>
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
@ -129,10 +128,9 @@ std::pair<int, int>
|
||||||
tokenise(std::string_view str, char delim)
|
tokenise(std::string_view str, char delim)
|
||||||
{
|
{
|
||||||
std::pair<int, int> ret;
|
std::pair<int, int> ret;
|
||||||
|
ret.first = std::atoi(str.data());
|
||||||
auto pos = str.find_first_of(delim);
|
auto pos = str.find_first_of(delim);
|
||||||
auto s = str.data();
|
ret.second = std::atoi(str.data() + pos + 1);
|
||||||
std::from_chars(s, s + pos, ret.first);
|
|
||||||
std::from_chars(s + pos + 1, s + str.size(), ret.second);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue