Remove (invalid) TODO note. Rename variable more meaningfully. Remove stray whitespace that crept into previous commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25927 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2008-06-11 14:29:59 +00:00
parent 1b007c20ad
commit 819eb21bbf
+6 -9
View File
@@ -174,7 +174,7 @@ BList::RemoveItem(int32 index)
if (index >= 0 && index < fItemCount) { if (index >= 0 && index < fItemCount) {
item = fObjectList[index]; item = fObjectList[index];
move_items(fObjectList + index + 1, -1, fItemCount - index - 1); move_items(fObjectList + index + 1, -1, fItemCount - index - 1);
Resize(fItemCount - 1); Resize(fItemCount - 1);
} }
return item; return item;
} }
@@ -437,14 +437,11 @@ BList::Resize(int32 count)
// by doubling the existing size // by doubling the existing size
// until we can hold at least count items // until we can hold at least count items
int32 newSize = fBlockSize; int32 newSize = fBlockSize;
// TODO: determine why modifying count directly via int32 targetSize = count;
// if (count <= 0) count = fBlockSize; if (targetSize <= 0)
// results in this code segfaulting the registrar while using the local var 'c' does not. targetSize = fBlockSize;
int32 c = count; if ((size_t)targetSize != fPhysicalSize) {
if (c <= 0) while (newSize < targetSize)
c = fBlockSize;
if ((size_t)c != fPhysicalSize) {
while (newSize < c)
newSize <<= 1; newSize <<= 1;
} }