Replace unused resize() call

Calling resize(size()) will only zero out elements that exist above the
vector size().  The memory is not freed in this case.  shrink_to_fit()
will accomplish this action (at the discretion of the library)
This commit is contained in:
Seth Hillbrand 2019-12-05 08:21:48 -08:00
parent 4d2e953f42
commit 6f8b399c5f
1 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
else if( ( coordinate[0] == ' ' ) && ( coordinate[1] == 'R' ) ) else if( ( coordinate[0] == ' ' ) && ( coordinate[1] == 'R' ) )
{ {
if( pointList ) if( pointList )
pointList->resize( pointList->size() ); pointList->shrink_to_fit();
// Raise pen // Raise pen
pointList = nullptr; pointList = nullptr;
@ -143,7 +143,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
} }
if( pointList ) if( pointList )
pointList->resize( pointList->size() ); pointList->shrink_to_fit();
// Compute the bounding box of the glyph // Compute the bounding box of the glyph
g_newStrokeFontGlyphBoundingBoxes->emplace_back( computeBoundingBox( glyph, glyphWidth ) ); g_newStrokeFontGlyphBoundingBoxes->emplace_back( computeBoundingBox( glyph, glyphWidth ) );