make code more efficient

This commit is contained in:
Michael Barz
2022-01-19 13:39:17 +01:00
parent 4d4dca512b
commit 3375207a0c
+7 -7
View File
@@ -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: