From c49e93d4d45815157cfccf6a4af86d8b6e6fa08f Mon Sep 17 00:00:00 2001
From: mattijs <mattijs@hunt.opencfd.co.uk>
Date: Mon, 13 Oct 2008 09:34:08 +0100
Subject: [PATCH] unecessary shrink

---
 src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
index da6bd13067e..9fdfe21bb19 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
@@ -79,8 +79,9 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
     const label s
 )
 {
-    if (s < List<T>::size())
+    if (s <= List<T>::size())
     {
+        // shrink addressable size, leave allocated size untouched
         List<T>::size() = s;
     }
     else
@@ -100,8 +101,9 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
     const T& t
 )
 {
-    if (s < List<T>::size())
+    if (s <= List<T>::size())
     {
+        // shrink addressable size, leave allocated size untouched
         List<T>::size() = s;
     }
     else
-- 
GitLab