From 3375207a0c8660d850cfb32477bfd0a93ac6dfa5 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Wed, 19 Jan 2022 13:39:17 +0100 Subject: [PATCH] make code more efficient --- graph/pkg/service/v0/drives.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/graph/pkg/service/v0/drives.go b/graph/pkg/service/v0/drives.go index 94b1f6927..2757c8cd9 100644 --- a/graph/pkg/service/v0/drives.go +++ b/graph/pkg/service/v0/drives.go @@ -100,16 +100,16 @@ func (g Graph) GetSingleDrive(w http.ResponseWriter, r *http.Request) { g.logger.Info().Str("driveID", driveID).Msg("Calling GetSingleDrive") ctx := r.Context() - var filters []*storageprovider.ListStorageSpacesRequest_Filter - filterDriveID := &storageprovider.ListStorageSpacesRequest_Filter{ - Type: storageprovider.ListStorageSpacesRequest_Filter_TYPE_ID, - Term: &storageprovider.ListStorageSpacesRequest_Filter_Id{ - Id: &storageprovider.StorageSpaceId{ - OpaqueId: driveID, + filters := []*storageprovider.ListStorageSpacesRequest_Filter{ + { + Type: storageprovider.ListStorageSpacesRequest_Filter_TYPE_ID, + Term: &storageprovider.ListStorageSpacesRequest_Filter_Id{ + Id: &storageprovider.StorageSpaceId{ + OpaqueId: driveID, + }, }, }, } - filters = append(filters, filterDriveID) res, err := g.ListStorageSpacesWithFilters(ctx, filters) switch { case err != nil: