inline variable

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2022-01-19 08:40:56 +00:00
parent e9ccf09c20
commit 6e6c2a127b
+2 -2
View File
@@ -115,13 +115,13 @@ func cs3TimestampToTime(t *types.Timestamp) time.Time {
func cs3ResourceToDriveItem(res *storageprovider.ResourceInfo) (*libregraph.DriveItem, error) {
size := new(int64)
*size = int64(res.Size) // uint64 -> int :boom:
name := path.Base(res.Path)
driveItem := &libregraph.DriveItem{
Id: &res.Id.OpaqueId,
Size: size,
}
if name != "" {
if name := path.Base(res.Path); name != "" {
driveItem.Name = &name
}
if res.Etag != "" {