From 2c8254d6c3c2f5a601e880ce436ae76df5d153ec Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Wed, 25 Sep 2013 16:38:10 -0400 Subject: [PATCH] Small optimization: reserve vector data before we populate blocks vector. --- PVRTCEncoder/src/Compressor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVRTCEncoder/src/Compressor.cpp b/PVRTCEncoder/src/Compressor.cpp index 850f5d0..2b167a6 100644 --- a/PVRTCEncoder/src/Compressor.cpp +++ b/PVRTCEncoder/src/Compressor.cpp @@ -296,7 +296,9 @@ namespace PVRTCC { // Pack everything into a PVRTC blocks. const uint32 blocksW = dcj.width / 4; const uint32 blocksH = dcj.height / 4; + std::vector blocks; + blocks.reserve(blocksW * blocksH); for(uint32 j = 0; j < blocksH; j++) { for(uint32 i = 0; i < blocksW; i++) { Block b;