mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 21:06:58 +00:00
(svn r19474) -Cleanup: remove ByteBlob::Append(T*, num_items)
This commit is contained in:
parent
aaa8fc7a4c
commit
ea58a697c1
@ -350,6 +350,7 @@ public:
|
||||
{
|
||||
return (base::Capacity() / type_size);
|
||||
}
|
||||
|
||||
/** Return number of additional items that can fit in the Blob without buffer reallocation */
|
||||
FORCEINLINE uint GetReserve() const
|
||||
{
|
||||
@ -362,16 +363,6 @@ public:
|
||||
return (T*)base::Append(num_items * type_size);
|
||||
}
|
||||
|
||||
/** Add given items (ptr + number of items) at the end of blob */
|
||||
FORCEINLINE T *Append(const T *pSrc, uint num_items)
|
||||
{
|
||||
T *pDst = GrowSizeNC(num_items);
|
||||
T *pDstOrg = pDst;
|
||||
T *pDstEnd = pDst + num_items;
|
||||
while (pDst < pDstEnd) new (pDst++) T(*(pSrc++));
|
||||
return pDstOrg;
|
||||
}
|
||||
|
||||
/** Ensures that given number of items can be added to the end of Blob. Returns pointer to the
|
||||
* first free (unused) item */
|
||||
FORCEINLINE T *MakeFreeSpace(uint num_items)
|
||||
|
Loading…
Reference in New Issue
Block a user