mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +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()
|
||||
{
|
||||
if(allocated_data > submitted_data)
|
||||
{
|
||||
flushed_data = allocated_data;
|
||||
return;
|
||||
}
|
||||
|
||||
if(submitted_data)
|
||||
{
|
||||
memcpy(data.data(), &data[flushed_data], allocated_data - flushed_data);
|
||||
allocated_data -= flushed_data;
|
||||
flushed_data = allocated_data;
|
||||
submitted_data = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
allocated_data = 0;
|
||||
flushed_data = 0;
|
||||
memcpy(data.data(), &data[submitted_data], allocated_data - submitted_data);
|
||||
allocated_data -= submitted_data;
|
||||
flushed_data -= submitted_data;
|
||||
submitted_data = 0;
|
||||
}
|
||||
|
||||
flushed_data = allocated_data;
|
||||
}
|
||||
|
||||
size_t ArrayBuilder::Buffer::submit(bool is_input)
|
||||
|
Loading…
Reference in New Issue
Block a user