diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-11-29 18:01:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-29 18:01:24 +0100 |
commit | 7ced03216a47327d64f68c750114a96cfcbae38b (patch) | |
tree | a797b79d0a750972ba9809eb52691cb09f9b6383 /storage/memory | |
parent | c07c778ed043429427533e2fd7549a3d54b903f1 (diff) | |
parent | 18e6f9daa3899318d36b525b068837f49bc2c1cf (diff) | |
download | go-git-7ced03216a47327d64f68c750114a96cfcbae38b.tar.gz |
Merge pull request #667 from ferhatelmas/simplify
all: simplification
Diffstat (limited to 'storage/memory')
-rw-r--r-- | storage/memory/storage.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/storage/memory/storage.go b/storage/memory/storage.go index c9306ee..927ec41 100644 --- a/storage/memory/storage.go +++ b/storage/memory/storage.go @@ -30,17 +30,17 @@ type Storage struct { // NewStorage returns a new Storage base on memory func NewStorage() *Storage { return &Storage{ - ReferenceStorage: make(ReferenceStorage, 0), + ReferenceStorage: make(ReferenceStorage), ConfigStorage: ConfigStorage{}, ShallowStorage: ShallowStorage{}, ObjectStorage: ObjectStorage{ - Objects: make(map[plumbing.Hash]plumbing.EncodedObject, 0), - Commits: make(map[plumbing.Hash]plumbing.EncodedObject, 0), - Trees: make(map[plumbing.Hash]plumbing.EncodedObject, 0), - Blobs: make(map[plumbing.Hash]plumbing.EncodedObject, 0), - Tags: make(map[plumbing.Hash]plumbing.EncodedObject, 0), + Objects: make(map[plumbing.Hash]plumbing.EncodedObject), + Commits: make(map[plumbing.Hash]plumbing.EncodedObject), + Trees: make(map[plumbing.Hash]plumbing.EncodedObject), + Blobs: make(map[plumbing.Hash]plumbing.EncodedObject), + Tags: make(map[plumbing.Hash]plumbing.EncodedObject), }, - ModuleStorage: make(ModuleStorage, 0), + ModuleStorage: make(ModuleStorage), } } @@ -152,7 +152,7 @@ func flattenObjectMap(m map[plumbing.Hash]plumbing.EncodedObject) []plumbing.Enc func (o *ObjectStorage) Begin() storer.Transaction { return &TxObjectStorage{ Storage: o, - Objects: make(map[plumbing.Hash]plumbing.EncodedObject, 0), + Objects: make(map[plumbing.Hash]plumbing.EncodedObject), } } @@ -189,7 +189,7 @@ func (tx *TxObjectStorage) Commit() error { } func (tx *TxObjectStorage) Rollback() error { - tx.Objects = make(map[plumbing.Hash]plumbing.EncodedObject, 0) + tx.Objects = make(map[plumbing.Hash]plumbing.EncodedObject) return nil } |