mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-03-22 15:19:52 +01:00
don't use std::pow here
This commit is contained in:
parent
2a829c2394
commit
8fe3ca0f5c
@ -2380,7 +2380,7 @@ void GameSave::ConvertBsonToJson(bson_iterator *iter, Json::Value *j, int depth)
|
||||
(*j)["links"].append(bson_iterator_int(&arrayiter));
|
||||
}
|
||||
length2++;
|
||||
if (length > (int)(40 / std::pow(depth+1, 2)) || length2 > 50)
|
||||
if (length > (int)(40 / ((depth+1) * (depth+1))) || length2 > 50)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2446,7 +2446,7 @@ void GameSave::ConvertJsonToBson(bson *b, Json::Value j, int depth)
|
||||
}
|
||||
if (!j[member][i].isObject())
|
||||
continue;
|
||||
if (depth > 4 || length > (int)(40 / std::pow(depth+1, 2)))
|
||||
if (depth > 4 || length > (int)(40 / ((depth+1) * (depth+1))))
|
||||
{
|
||||
std::set<int> nestedSaveIDs = GetNestedSaveIDs(j[member][i]);
|
||||
saveIDs.insert(nestedSaveIDs.begin(), nestedSaveIDs.end());
|
||||
|
Loading…
x
Reference in New Issue
Block a user