Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cnguts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,7 @@ static RC checkSubMeterList( // helper for input-time checking submeter list
{
RC rc = RCOK;

bool bSeen[DIM_SUBMETERLIST] = { false };
std::vector<TI> seenList;

const TI* subMeterList = reinterpret_cast<const TI*>(pR->field(fnList));

Expand All @@ -2154,7 +2154,7 @@ static RC checkSubMeterList( // helper for input-time checking submeter list
const char* msg = nullptr;
if (subMeterList[i] == pR->ss)
msg = "Invalid submeter self-reference";
else if (bSeen[subMeterList[i]])
else if (std::find( seenList.begin(), seenList.end(), subMeterList[i]) != seenList.end())
msg = "Duplicate submeter reference";

if (msg)
Expand All @@ -2164,7 +2164,7 @@ static RC checkSubMeterList( // helper for input-time checking submeter list
pRSM ? pRSM->Name() : "?", i + 1, listArgName, msg);
}

bSeen[subMeterList[i]] = true;
seenList.push_back( subMeterList[ i]);
}

return rc;
Expand Down