1
0
Fork 0

Move change in VelocyPack Builder ValuePair String API here.

This commit is contained in:
Max Neunhoeffer 2016-03-14 21:24:29 +01:00
parent 3850ace12c
commit 646367f955
1 changed files with 3 additions and 5 deletions

View File

@ -704,18 +704,16 @@ uint8_t* Builder::set(ValuePair const& pair) {
reserveSpace(1 + 8 + size);
_start[_pos++] = 0xbf;
appendLength(size, 8);
memcpy(_start + _pos, pair.getStart(), checkOverflow(size));
_pos += size;
} else {
// short string
reserveSpace(1 + size);
_start[_pos++] = static_cast<uint8_t>(0x40 + size);
memcpy(_start + _pos, pair.getStart(), checkOverflow(size));
_pos += size;
}
// Note that the data is not filled in! It is the responsibility
// of the caller to fill in
// _start + _pos - size .. _start + _pos - 1
// with valid UTF-8!
return _start + _pos - size;
return _start + oldPos;
} else if (pair.valueType() == ValueType::Custom) {
// We only reserve space here, the caller has to fill in the custom type
uint64_t size = pair.getSize();