mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-04-27 18:30:50 +02:00
more changes per cr
This commit is contained in:
parent
05c1b8344d
commit
59167d8627
@ -1034,12 +1034,12 @@ bool Value::removeIndex(ArrayIndex index, Value* removed) {
|
|||||||
*removed = it->second;
|
*removed = it->second;
|
||||||
ArrayIndex oldSize = size();
|
ArrayIndex oldSize = size();
|
||||||
// shift left all items left, into the place of the "removed"
|
// shift left all items left, into the place of the "removed"
|
||||||
for (ArrayIndex i=index; i<oldSize-1; i++){
|
for (ArrayIndex i = index; i < (oldSize - 1); ++i){
|
||||||
CZString key(i);
|
CZString key(i);
|
||||||
(*value_.map_)[key] = (*this)[i+1];
|
(*value_.map_)[key] = (*this)[i + 1];
|
||||||
}
|
}
|
||||||
// erase the last one ("leftover")
|
// erase the last one ("leftover")
|
||||||
CZString keyLast(oldSize-1);
|
CZString keyLast(oldSize - 1);
|
||||||
ObjectValues::iterator itLast = value_.map_->find(keyLast);
|
ObjectValues::iterator itLast = value_.map_->find(keyLast);
|
||||||
value_.map_->erase(itLast);
|
value_.map_->erase(itLast);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user