BlockArray::MakeEmpty() can now also be called before the block has been actually used.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12911 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-05-31 01:18:34 +00:00
parent dde78a340e
commit 809025e47c
@@ -1,8 +1,8 @@
/* Utility - some helper classes /* Utility - some helper classes
** *
** Initial version by Axel Dörfler, [email protected] * Copyright 2001-2005, Axel Dörfler, [email protected].
** This file may be used under the terms of the OpenBeOS License. * This file may be used under the terms of the MIT License.
*/ */
#include "Utility.h" #include "Utility.h"
@@ -85,8 +85,7 @@ BlockArray::BlockArray(int32 blockSize)
BlockArray::~BlockArray() BlockArray::~BlockArray()
{ {
if (fArray) free(fArray);
free(fArray);
} }
@@ -134,7 +133,8 @@ BlockArray::Remove(off_t value)
void void
BlockArray::MakeEmpty() BlockArray::MakeEmpty()
{ {
fArray->count = 0; if (fArray != NULL)
fArray->count = 0;
} }