drop this-> (team preference)

This commit is contained in:
Christopher Dunn 2015-01-21 15:43:48 -06:00
parent e893625e88
commit 05c1b8344d

View File

@ -1019,7 +1019,7 @@ Value Value::removeMember(const std::string& key) {
}
bool Value::removeIndex(ArrayIndex index, Value* removed) {
if (this->type_ != arrayValue) {
if (type_ != arrayValue) {
return false;
}
#ifdef JSON_VALUE_USE_INTERNAL_MAP
@ -1027,21 +1027,21 @@ bool Value::removeIndex(ArrayIndex index, Value* removed) {
return false;
#else
CZString key(index);
ObjectValues::iterator it = this->value_.map_->find(key);
if (it == this->value_.map_->end()) {
ObjectValues::iterator it = value_.map_->find(key);
if (it == value_.map_->end()) {
return false;
}
*removed = it->second;
ArrayIndex oldSize = this->size();
ArrayIndex oldSize = size();
// shift left all items left, into the place of the "removed"
for (ArrayIndex i=index; i<oldSize-1; i++){
CZString key(i);
(*this->value_.map_)[key] = (*this)[i+1];
(*value_.map_)[key] = (*this)[i+1];
}
// erase the last one ("leftover")
CZString keyLast(oldSize-1);
ObjectValues::iterator itLast = this->value_.map_->find(keyLast);
this->value_.map_->erase(itLast);
ObjectValues::iterator itLast = value_.map_->find(keyLast);
value_.map_->erase(itLast);
return true;
#endif
}