Skip to content

Commit

Permalink
address cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Nov 7, 2024
1 parent 2144c21 commit 93af06f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/alfalfa/AlfalfaJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace alfalfa {
Json::Value AlfalfaJSON_Impl::toJSON() const {
Json::Value root;
int i = 0;
for (auto& point : points()) {
for (const auto& point : points()) {
// No guard here as the toJSON call will throw an exception if the id does not exist.
root[i++] = point.toJSON();
}
Expand Down
2 changes: 1 addition & 1 deletion src/alfalfa/test/AlfalfaJSON_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ TEST(AlfalfaJSON, json_serialization) {
EXPECT_TRUE(parsing_success);
EXPECT_EQ(alfalfa.toJSON(), root);
int i = 0;
for (auto& point : alfalfa.points()) {
for (const auto& point : alfalfa.points()) {
EXPECT_EQ(root[i++], point.toJSON());
}
}
Expand Down

0 comments on commit 93af06f

Please sign in to comment.