public void revertEdits(SimObject profile) { for (uint i = 0; i < this.getCount(); i ++) { SimObject obj = this.getObject(i); if (obj["profile"] != profile) continue; profile.setFieldValue(obj["fieldName"], obj["oldValue"], obj["arrayIndex"].AsInt()); obj.delete(); i --; } }