mirror of https://gitee.com/bigwinds/arangodb
Move change in VelocyPack Builder ValuePair String API here.
This commit is contained in:
parent
3850ace12c
commit
646367f955
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue