Remove special case for empty slices

pull/650/head
Herman Slatman 2 years ago
parent ef16febf40
commit c0eb420806
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -387,10 +387,6 @@ func (db *DB) addEAKID(ctx context.Context, provisionerID, eakID string) error {
_new interface{} = newEAKIDs
)
if len(eakIDs) == 0 {
_old = nil
}
if err = db.save(ctx, provisionerID, _new, _old, "externalAccountKeysByProvisionerID", externalAccountKeysByProvisionerIDTable); err != nil {
return errors.Wrapf(err, "error saving eakIDs index for provisioner %s", provisionerID)
}
@ -420,13 +416,6 @@ func (db *DB) deleteEAKID(ctx context.Context, provisionerID, eakID string) erro
_new interface{} = newEAKIDs
)
switch {
case len(eakIDs) == 0:
_old = nil
case len(newEAKIDs) == 0:
_new = nil
}
if err = db.save(ctx, provisionerID, _new, _old, "externalAccountKeysByProvisionerID", externalAccountKeysByProvisionerIDTable); err != nil {
return errors.Wrapf(err, "error saving referenceIDs index for provisioner %s", provisionerID)
}

Loading…
Cancel
Save