Fix parsing of comments at the end of lines for tokens with variable number of elements. (#5890) (#5891)

* Fix parsing of comments at the end of lines for tokens with variable number of elements. (#5890)

* Fixed Quality Gate issues.

Reduced nesting of the break statements.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit is contained in:
Sebastian Schäfer
2024-12-17 18:17:02 +01:00
committed by GitHub
parent 2b773f0f5a
commit 2090508c34
2 changed files with 5 additions and 5 deletions

View File

@@ -300,7 +300,7 @@ size_t ObjFileParser::getNumComponentsInDataDefinition() {
} else if (IsLineEnd(*tmp)) {
end_of_definition = true;
}
if (!SkipSpaces(&tmp, mEnd)) {
if (!SkipSpaces(&tmp, mEnd) || *tmp == '#') {
break;
}
const bool isNum(IsNumeric(*tmp) || isNanOrInf(tmp));
@@ -308,11 +308,11 @@ size_t ObjFileParser::getNumComponentsInDataDefinition() {
if (isNum) {
++numComponents;
}
if (!SkipSpaces(&tmp, mEnd)) {
if (!SkipSpaces(&tmp, mEnd) || *tmp == '#') {
break;
}
}
return numComponents;
}
@@ -451,7 +451,7 @@ void ObjFileParser::getFace(aiPrimitiveType type) {
while (m_DataIt < m_DataItEnd) {
int iStep = 1;
if (IsLineEnd(*m_DataIt)) {
if (IsLineEnd(*m_DataIt) || *m_DataIt == '#') {
break;
}