small fix in array lists
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ struct Array_List {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void reserve(unsigned int count) {
|
void reserve(unsigned int count) {
|
||||||
if (next_index+count <= (unsigned int)length) {
|
if (next_index+count >= (unsigned int)length) {
|
||||||
length *= 2;
|
length *= 2;
|
||||||
data = (type*)realloc(data, length * sizeof(type));
|
data = (type*)realloc(data, length * sizeof(type));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user