Improve array KVO performance a bit

This commit is contained in:
Thomas Goyne 2015-09-02 11:04:01 -07:00 committed by Ari Lazier
parent 2f869541c7
commit 429a652eeb
1 changed files with 1 additions and 8 deletions

View File

@ -193,14 +193,7 @@ public:
} }
else if (o->kind == kind) { else if (o->kind == kind) {
if (kind == ColumnInfo::Kind::Remove) { if (kind == ColumnInfo::Kind::Remove) {
// Shift the index to compensate for already-removed indices o->indices.add_shifted(index);
for (auto i : o->indices) {
if (i <= index)
++index;
else
break;
}
o->indices.add(index);
} }
else if (kind == ColumnInfo::Kind::Insert) { else if (kind == ColumnInfo::Kind::Insert) {
o->indices.insert_at(index); o->indices.insert_at(index);