Skip to content

Commit f28905a

Browse files
authored
Merge pull request #4719 from telefonicaid/hardening/style-fix
FIX code style
2 parents bc66a8f + 9dbf3ec commit f28905a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/mongoBackend/mongoQueryContext.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,12 @@ HttpStatusCode mongoQueryContext
361361

362362
// Check for duplicate tokens (with or without "!" prefix)
363363
std::set<std::string> uniqueTokens;
364-
for (const auto& token : sortedV) {
364+
for (size_t i = 0; i < sortedV.size(); ++i)
365+
{
366+
std::string token = sortedV[i];
365367
std::string normalizedToken = (token[0] == '!') ? token.substr(1) : token;
366-
if (!uniqueTokens.insert(normalizedToken).second) {
368+
if (!uniqueTokens.insert(normalizedToken).second)
369+
{
367370
alarmMgr.badInput(clientIp, ERROR_DESC_BAD_REQUEST_DUPLICATED_ORDERBY);
368371
responseP->error.fill(SccBadRequest, ERROR_DESC_BAD_REQUEST_DUPLICATED_ORDERBY);
369372

0 commit comments

Comments
 (0)