From 6f8b399c5fa086b601e5931ecb4effcd7d90da84 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 5 Dec 2019 08:21:48 -0800 Subject: [PATCH] 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) --- common/gal/stroke_font.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp index 0e64fe6b37..f09093c67d 100644 --- a/common/gal/stroke_font.cpp +++ b/common/gal/stroke_font.cpp @@ -108,7 +108,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe else if( ( coordinate[0] == ' ' ) && ( coordinate[1] == 'R' ) ) { if( pointList ) - pointList->resize( pointList->size() ); + pointList->shrink_to_fit(); // Raise pen pointList = nullptr; @@ -143,7 +143,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe } if( pointList ) - pointList->resize( pointList->size() ); + pointList->shrink_to_fit(); // Compute the bounding box of the glyph g_newStrokeFontGlyphBoundingBoxes->emplace_back( computeBoundingBox( glyph, glyphWidth ) );