From 22aef424814d98ff705b2e3dcd9c2aa56184e318 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 10 Jun 2008 23:25:33 +0000 Subject: [PATCH] Revert this change until I determine why it now crashes the app_server when it didn't during my tests. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25919 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/support/List.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/kits/support/List.cpp b/src/kits/support/List.cpp index 6424e8ca70..c0f1481e19 100644 --- a/src/kits/support/List.cpp +++ b/src/kits/support/List.cpp @@ -174,7 +174,7 @@ BList::RemoveItem(int32 index) if (index >= 0 && index < fItemCount) { item = fObjectList[index]; move_items(fObjectList + index + 1, -1, fItemCount - index - 1); - Resize(fItemCount - 1); + Resize(fItemCount - 1); } return item; } @@ -433,17 +433,11 @@ bool BList::Resize(int32 count) { bool result = true; - // calculate the new physical size - // by doubling the existing size - // until we can hold at least count items - int32 newSize = fBlockSize; - if (count <= 0) - count = fBlockSize; - if ((size_t)count != fPhysicalSize) - while (newSize < count) - newSize <<= 1; - + int32 newSize = count; + if (newSize <= 0) + newSize = 1; + newSize = ((newSize - 1) / fBlockSize + 1) * fBlockSize; // resize if necessary if ((size_t)newSize != fPhysicalSize) { void** newObjectList