From c0eb420806058a198a6a4daaa7e8fbafe7aa1f77 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Thu, 20 Jan 2022 11:03:49 +0100 Subject: [PATCH] Remove special case for empty slices --- acme/db/nosql/account.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/acme/db/nosql/account.go b/acme/db/nosql/account.go index d3b9949a..4cff6653 100644 --- a/acme/db/nosql/account.go +++ b/acme/db/nosql/account.go @@ -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) }