mirror of https://gitee.com/bigwinds/arangodb
Construct builder with prefilled buffer. Agency store increment, decrement, push pop
This commit is contained in:
parent
5acdc36d07
commit
af56c18345
|
@ -176,10 +176,7 @@ Node& Node::write (std::string const& path) {
|
|||
|
||||
bool Node::applies (arangodb::velocypack::Slice const& slice) {
|
||||
if (slice.type() == ValueType::Object) {
|
||||
VPackObjectIterator sit (slice);
|
||||
|
||||
auto b = sit.begin();
|
||||
auto i = *b;
|
||||
for (auto const& i : VPackObjectIterator(slice)) {
|
||||
std::string key = i.key.toString();
|
||||
key = key.substr(1,key.length()-2);
|
||||
if (key == "op") {
|
||||
|
@ -213,8 +210,6 @@ bool Node::applies (arangodb::velocypack::Slice const& slice) {
|
|||
for (auto const& old : VPackArrayIterator(self))
|
||||
tmp.add(old);
|
||||
tmp.close();
|
||||
auto nval = *++b;
|
||||
std::cout << nval.value.toString() << std::endl;
|
||||
*this = tmp.slice();
|
||||
}
|
||||
} else if (oper == "pop") { // Pop
|
||||
|
@ -223,6 +218,7 @@ bool Node::applies (arangodb::velocypack::Slice const& slice) {
|
|||
tmp.openArray();
|
||||
VPackArrayIterator it(self);
|
||||
size_t j = it.size()-1;
|
||||
std::cout << j << std::endl;
|
||||
for (auto old : it) {
|
||||
tmp.add(old);
|
||||
if (--j==0)
|
||||
|
@ -241,7 +237,7 @@ bool Node::applies (arangodb::velocypack::Slice const& slice) {
|
|||
}
|
||||
_children[key]->applies(i.value);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
*this = slice;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue