Use C++11 range-based for loops where we can

This commit is contained in:
FeRD (Frank Dana)
2019-12-27 01:01:48 -05:00
parent dc217a9bdf
commit e49f62247e
10 changed files with 53 additions and 123 deletions

View File

@@ -333,9 +333,7 @@ Json::Value Keyframe::JsonValue() const {
root["Points"] = Json::Value(Json::arrayValue);
// loop through points, and find a matching coordinate
for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) {
// Get each point
Point existing_point = Points[x];
for (auto existing_point : Points) {
root["Points"].append(existing_point.JsonValue());
}
@@ -379,10 +377,7 @@ void Keyframe::SetJsonValue(Json::Value root) {
if (!root["Points"].isNull())
// loop through points
for (int64_t x = 0; x < root["Points"].size(); x++) {
// Get each point
Json::Value existing_point = root["Points"][(Json::UInt) x];
for (const auto existing_point : root["Points"]) {
// Create Point
Point p;