From 0aa4b668a98454ccd1b81351dc42142c09687a53 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 18 Jan 2017 11:10:31 +0100 Subject: [PATCH] Makes CollectDataToIORank::localIndexMap_ have nonzero size when accessing. While it may not produce memory errors it is semantically wrong to insert entries with random acces into a vector that has reserved enough memory to hold the values but still has size 0. --- ebos/collecttoiorank.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebos/collecttoiorank.hh b/ebos/collecttoiorank.hh index 15e490555..2681d9e74 100644 --- a/ebos/collecttoiorank.hh +++ b/ebos/collecttoiorank.hh @@ -223,7 +223,7 @@ namespace Ewoms localIndexMap_.clear(); const size_t gridSize = gridManager.grid().size( 0 ); - localIndexMap_.reserve( gridSize ); + localIndexMap_.resize( gridSize, -1 ); // store the local Cartesian index IndexMapType distributedCartesianIndex;