MINOR: optimized code when deleting multiple fields

This commit is contained in:
Will Rossiter 2009-05-28 08:40:23 +00:00
parent d60a118083
commit 7d39887df3

View File

@ -127,10 +127,10 @@ class FieldEditor extends FormField {
} }
// remove the fields not saved // remove the fields not saved
foreach($missingFields as $removedField) { if($this->canEdit()) {
if(is_numeric($removedField->ID)) { foreach($missingFields as $removedField) {
// check we can edit this if(is_numeric($removedField->ID)) {
if($this->canEdit()) { // check we can edit this
$removedField->delete(); $removedField->delete();
} }
} }