From ddb4fef4b27b30b08ea92db79d0a1a9cec03d451 Mon Sep 17 00:00:00 2001 From: Tom Beach Date: Fri, 1 Sep 2023 16:14:21 +0100 Subject: [PATCH] Fix Bug with line insertion --- src/wasm/parsing/IfcLoader.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/wasm/parsing/IfcLoader.cpp b/src/wasm/parsing/IfcLoader.cpp index 973c47d6..339c81a9 100644 --- a/src/wasm/parsing/IfcLoader.cpp +++ b/src/wasm/parsing/IfcLoader.cpp @@ -404,20 +404,17 @@ namespace webifc::parsing { void IfcLoader::UpdateLineTape(const uint32_t expressID, const uint32_t type, const uint32_t start) { - if (_lines.size() < expressID) _lines.resize(expressID,_nullLine); - // new line? - if (_lines[expressID-1] == _nullLine) + if (expressID >= _lines.size()) { // create line object IfcLine * line = new IfcLine(); - _lines[expressID-1]=line; + _lines.push_back(line); // fill line data line->ifcType = type; - + line->tapeOffset = start; _ifcTypeToExpressID[type].push_back(expressID); - } - _lines[expressID-1]->tapeOffset = start; + } else _lines[expressID-1]->tapeOffset = start; } void IfcLoader::AddHeaderLineTape(const uint32_t type, const uint32_t start)