From 29bf819ab1c8973566d8a06032e790c5a24f88f4 Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Wed, 16 Mar 2022 15:08:42 +0100 Subject: [PATCH] Avoid empty array allocations --- storage/filesystem.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/filesystem.go b/storage/filesystem.go index d958331..72b8188 100644 --- a/storage/filesystem.go +++ b/storage/filesystem.go @@ -135,7 +135,7 @@ func createDefaultAddressBook(path string) error { Name: "My contacts", Description: "Default address book", MaxResourceSize: 1024, - SupportedAddressData: []carddav.AddressDataType{}, + SupportedAddressData: nil, } blob, err := json.MarshalIndent(defaultAB, "", " ") if err != nil { @@ -211,7 +211,7 @@ func (b *filesystemBackend) GetAddressObject(ctx context.Context, path string, r } func (b *filesystemBackend) loadAll(ctx context.Context, propFilter []string) ([]carddav.AddressObject, error) { - result := []carddav.AddressObject{} + var result []carddav.AddressObject path, err := b.pathForContext(ctx) if err != nil {