Skip to content

Commit

Permalink
don't use std::pow here
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jul 29, 2017
1 parent 2a829c2 commit 8fe3ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/GameSave.cpp
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 8fe3ca0

Please sign in to comment.