Skip to content

Commit b23d7b9

Browse files
committed
Resize rather than just reserve space in feature vector creation. Quietens abort in debug
1 parent 8afc7d0 commit b23d7b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/FeatureMap.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ bool FeatureRef::applyValToFeature(uint32 val, Features & pDest) const
275275
else
276276
if (pDest.m_pMap!=&m_pFace->theSill().theFeatureMap())
277277
return false; //incompatible
278-
pDest.reserve(m_index+1);
278+
if (m_index >= pDest.size())
279+
pDest.resize(m_index+1);
279280
pDest[m_index] &= ~m_mask;
280281
pDest[m_index] |= (uint32(val) << m_bits);
281282
return true;

0 commit comments

Comments
 (0)