Skip to content

Commit

Permalink
Fixed compilation warnings in for-each loops
Browse files Browse the repository at this point in the history
The warnings are seen when compiling the code by the C++20 compiler
  • Loading branch information
iagaponenko committed Sep 23, 2023
1 parent 5a5fa74 commit 4a9b8a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/partition/sph-duplicate2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ size_t duplicateObjectRow(std::string &line, part::SphericalBox const &box, std:
double decl(0.);

int idx = 0;
for (std::string const token : tokens) {
for (std::string const &token : tokens) {
if (coldefObject.idxDeepSourceId == idx) {
deepSourceId = boost::lexical_cast<uint64_t>(token);
} else if (coldefObject.idxRa == idx) {
Expand Down Expand Up @@ -764,7 +764,7 @@ size_t duplicateSourceRow(std::string &line, part::SphericalBox const &box, std:
double cluster_coord_decl(0.);

int idx = 0;
for (std::string const token : tokens) {
for (std::string const &token : tokens) {
if (coldefSource.idxId == idx) {
id = boost::lexical_cast<uint64_t>(token);
} else if (coldefSource.idxCoordRa == idx) {
Expand Down Expand Up @@ -915,7 +915,7 @@ size_t duplicateForcedSourceRow(std::string &line, part::SphericalBox const &box
uint64_t deepSourceId(0ULL);

int idx = 0;
for (std::string const token : tokens) {
for (std::string const &token : tokens) {
if (coldefForcedSource.idxDeepSourceId == idx) {
deepSourceId = boost::lexical_cast<uint64_t>(token);
}
Expand Down
8 changes: 4 additions & 4 deletions src/replica/HttpIngestModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ json HttpIngestModule::_getDatabases() {
debug(__func__, "isPublished=" + bool2str(isPublished));

json databasesJson = json::array();
for (auto const databaseName : config->databases(family, allDatabases, isPublished)) {
for (string const& databaseName : config->databases(family, allDatabases, isPublished)) {
auto const database = config->databaseInfo(databaseName);
databasesJson.push_back({{"name", database.name},
{"family", database.family},
Expand Down Expand Up @@ -414,12 +414,12 @@ json HttpIngestModule::_deleteDatabase() {
conn->execute(g.dropDb(database.name, ifExists));
auto const emptyChunkListTable = css::DbInterfaceMySql::getEmptyChunksTableName(database.name);
conn->execute(g.dropTable(g.id("qservCssData", emptyChunkListTable), ifExists));
for (auto const tableName : directorTables) {
for (string const& tableName : directorTables) {
string const query = g.dropTable(
g.id("qservMeta", directorIndexTableName(database.name, tableName)), ifExists);
conn->execute(query);
}
for (auto const tableName : database.tables()) {
for (string const& tableName : database.tables()) {
try {
string const query =
g.dropTable(g.id("qservMeta", rowCountersTable(database.name, tableName)), ifExists);
Expand Down Expand Up @@ -1077,7 +1077,7 @@ void HttpIngestModule::_removeMySQLPartitions(DatabaseInfo const& database, bool
bool const ignoreNonPartitioned = true;
string const noParentJobId;
string error;
for (auto const tableName : database.tables()) {
for (string const& tableName : database.tables()) {
auto const& table = database.findTable(tableName);
// Skip tables that have been published.
if (table.isPublished) continue;
Expand Down

0 comments on commit 4a9b8a4

Please sign in to comment.