Permalink
Browse files

don't use std::pow here

  • Loading branch information...
jacob1 committed Jul 29, 2017
1 parent 2a829c2 commit 8fe3ca0f5c64c3285bf750af2b3c408febdef48e
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/client/GameSave.cpp
@@ -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());

0 comments on commit 8fe3ca0

Please sign in to comment.