Skip to content

Commit 5e89ef9

Browse files
Follow-up to #1470 (#1482)
Changes there left the PatchRecordComponent dirty after parsing
1 parent c5d60d2 commit 5e89ef9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/backend/PatchRecordComponent.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ void PatchRecordComponent::read()
147147

148148
if (containsAttribute("unitSI"))
149149
{
150+
/*
151+
* No need to call setUnitSI
152+
* If it's in the attributes map, then it's already set
153+
* Just verify that it has the right type (getOptional<>() does
154+
* conversions if possible, so this check is non-intrusive)
155+
*/
150156
if (auto val = getAttribute("unitSI").getOptional<double>();
151-
val.has_value())
152-
{
153-
setUnitSI(val.value());
154-
}
155-
else
157+
!val.has_value())
156158
{
157159
throw error::ReadError(
158160
error::AffectedObject::Attribute,

0 commit comments

Comments
 (0)