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);
|
reserveSpace(1 + 8 + size);
|
||||||
_start[_pos++] = 0xbf;
|
_start[_pos++] = 0xbf;
|
||||||
appendLength(size, 8);
|
appendLength(size, 8);
|
||||||
|
memcpy(_start + _pos, pair.getStart(), checkOverflow(size));
|
||||||
_pos += size;
|
_pos += size;
|
||||||
} else {
|
} else {
|
||||||
// short string
|
// short string
|
||||||
reserveSpace(1 + size);
|
reserveSpace(1 + size);
|
||||||
_start[_pos++] = static_cast<uint8_t>(0x40 + size);
|
_start[_pos++] = static_cast<uint8_t>(0x40 + size);
|
||||||
|
memcpy(_start + _pos, pair.getStart(), checkOverflow(size));
|
||||||
_pos += size;
|
_pos += size;
|
||||||
}
|
}
|
||||||
// Note that the data is not filled in! It is the responsibility
|
return _start + oldPos;
|
||||||
// of the caller to fill in
|
|
||||||
// _start + _pos - size .. _start + _pos - 1
|
|
||||||
// with valid UTF-8!
|
|
||||||
return _start + _pos - size;
|
|
||||||
} else if (pair.valueType() == ValueType::Custom) {
|
} else if (pair.valueType() == ValueType::Custom) {
|
||||||
// We only reserve space here, the caller has to fill in the custom type
|
// We only reserve space here, the caller has to fill in the custom type
|
||||||
uint64_t size = pair.getSize();
|
uint64_t size = pair.getSize();
|
||||||
|
|
Loading…
Reference in New Issue