Merge pull request #3624 from blattms/move-lambda-prevent-warn

[janitor] Move lambda to prevent warning.
This commit is contained in:
Bård Skaflestad
2023-08-08 17:22:19 +02:00
committed by GitHub

View File

@@ -1577,17 +1577,6 @@ std::vector<std::string> Parser::getAllDeckNames () const {
std::string curSectionName = deck[0].name();
size_t curKwIdx = 1;
for (; curKwIdx < deck.size(); ++curKwIdx) {
const auto& curKeyword = deck[curKwIdx];
const std::string& curKeywordName = curKeyword.name();
if (!isSectionDelimiter( curKeyword )) {
if( !parser.isRecognizedKeyword( curKeywordName ) )
// ignore unknown keywords for now (i.e. they can appear in any section)
continue;
const bool isOperateKeyword =
Fieldprops::keywords::is_oper_keyword(curKeywordName);
auto checker = [&errorGuard, &deckValid, &parser, curSectionName,
ensureKeywordSectionAffiliation, errorKey]
(const std::string& curKeywordName, const KeywordLocation& location)
@@ -1607,6 +1596,17 @@ std::vector<std::string> Parser::getAllDeckNames () const {
}
};
const auto& curKeyword = deck[curKwIdx];
const std::string& curKeywordName = curKeyword.name();
if (!isSectionDelimiter( curKeyword )) {
if( !parser.isRecognizedKeyword( curKeywordName ) )
// ignore unknown keywords for now (i.e. they can appear in any section)
continue;
const bool isOperateKeyword =
Fieldprops::keywords::is_oper_keyword(curKeywordName);
if (isOperateKeyword) {
for (const auto& record : curKeyword) {
const auto& operName = record.getItem(0).getTrimmedString(0);