Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.1.0-m1
-
None
Description
In the code generated for the VariableLengthVectors there appears to be a double copy in the setSafe function that takes a Holder as a parameter. Snippet below is for the VarBinaryVector class.
public boolean setSafe(int index, VarBinaryHolder holder){
int start = holder.start;
int end = holder.end;
int len = end - start;
int outputStart = offsetVector.data.getInt(index * 4);
if(data.capacity() < outputStart + len)
{ decrementAllocationMonitor(); return false; } holder.buffer.getBytes(start, data, outputStart, len); // COPY 1
if (!offsetVector.getMutator().setSafe( index+1, outputStart + len))
set(index, holder); // COPY 2
return true;
}
if (!offsetVector.getMutator().setSafe( index+1, outputStart + len)) { return false; }
set(index, holder);
return true;
}
protected void set(int index, VarBinaryHolder holder)
The line holder.buffer.getBytes copies from the holder into 'data'.
Then in the set function, the data.setBytes call copies again.