mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Fixed code that was causing the failing test.
This commit is contained in:
parent
be60eaa120
commit
a4c7b00ecd
@ -139,25 +139,15 @@ uint8_t *ArrayBuilder::Buffer::reget_storage(size_t &size)
|
|||||||
|
|
||||||
void ArrayBuilder::Buffer::flush()
|
void ArrayBuilder::Buffer::flush()
|
||||||
{
|
{
|
||||||
if(allocated_data > submitted_data)
|
|
||||||
{
|
|
||||||
flushed_data = allocated_data;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(submitted_data)
|
if(submitted_data)
|
||||||
{
|
{
|
||||||
memcpy(data.data(), &data[flushed_data], allocated_data - flushed_data);
|
memcpy(data.data(), &data[submitted_data], allocated_data - submitted_data);
|
||||||
allocated_data -= flushed_data;
|
allocated_data -= submitted_data;
|
||||||
flushed_data = allocated_data;
|
flushed_data -= submitted_data;
|
||||||
submitted_data = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
allocated_data = 0;
|
|
||||||
flushed_data = 0;
|
|
||||||
submitted_data = 0;
|
submitted_data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flushed_data = allocated_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ArrayBuilder::Buffer::submit(bool is_input)
|
size_t ArrayBuilder::Buffer::submit(bool is_input)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user