mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
performance tweak for accumulating large amounts of data into a buffer.
eg. megabytes added in incremets of a few bytes at a time. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35328 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4d638f1cb0
commit
8a605b360a
2 changed files with 15 additions and 1 deletions
|
@ -3775,7 +3775,13 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
{
|
||||
if (size > capacity)
|
||||
{
|
||||
[self setCapacity: size];
|
||||
NSUInteger growTo = capacity + capacity / 2;
|
||||
|
||||
if (size > growTo)
|
||||
{
|
||||
growTo = size;
|
||||
}
|
||||
[self setCapacity: growTo];
|
||||
}
|
||||
if (size > length)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue