Final std::ws skipping not needed when parsing block coordinates, and it makes is.fail() == true
parent
22384eb9db
commit
3ffda4ab57
|
@ -7,7 +7,7 @@ void BlockPos::operator=(const std::string &s)
|
|||
std::istringstream is(s);
|
||||
if (isdigit(is.peek()) || is.peek() == '-' || is.peek() == '+') {
|
||||
int64_t ipos;
|
||||
is >> ipos >> std::ws;
|
||||
is >> ipos;
|
||||
if (is.fail() || !is.eof()) {
|
||||
throw std::runtime_error(std::string("Failed to decode i64 (minetest) coordinate string from database (") + s + ")" );
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ void BlockPos::operator=(const std::string &s)
|
|||
is >> y();
|
||||
is >> c2;
|
||||
is >> z();
|
||||
is >> std::ws;
|
||||
if (is.fail() || !is.eof() || c1 != ',' || c2 != ',') {
|
||||
throw std::runtime_error(std::string("Failed to decode axyz (freeminer) coordinate string from database (") + s + ")" );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue