1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-26 16:09:10 +00:00

(svn r15649) -Fix (r15556): don't unnecessarily reallocate

This commit is contained in:
rubidium
2009-03-09 09:38:00 +00:00
parent a231ab7560
commit 60de42be49

View File

@@ -102,6 +102,7 @@ public:
if (this->count < count) {
free(this->buffer);
this->buffer = MallocT<T>(count);
this->count = count;
}
return this->buffer;
}
@@ -118,6 +119,7 @@ public:
if (this->count < count) {
free(this->buffer);
this->buffer = CallocT<T>(count);
this->count = count;
} else {
memset(this->buffer, 0, sizeof(T) * count);
}