Replace all use of wantarray tri-calls with explicit return or preserve_context
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Ordered.pm
index 05da117..d5ebc55 100644 (file)
@@ -581,19 +581,11 @@ sub delete {
 
     $self->move_last;
 
-    my @res;
-    if (not defined wantarray) {
-        $self->next::method( @_ );
-    }
-    elsif (wantarray) {
-        @res = $self->next::method( @_ );
-    }
-    else {
-        $res[0] = $self->next::method( @_ );
-    }
+    $self->next::method( @_ );
 
     $guard->commit;
-    return wantarray ? @res : $res[0];
+
+    return $self;
 }
 
 # add the current position/group to the things we track old values for