diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/object.go | 5 | ||||
-rw-r--r-- | core/storage.go | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/object.go b/core/object.go index 7e021cb..6a22122 100644 --- a/core/object.go +++ b/core/object.go @@ -137,10 +137,11 @@ func (iter *ObjectLookupIter) Next() (Object, error) { return nil, io.EOF } hash := iter.series[iter.pos] - obj, err := iter.storage.Get(hash, AnyObject) + obj, err := iter.storage.Get(AnyObject, hash) if err == nil { iter.pos++ } + return obj, err } @@ -151,7 +152,7 @@ func (iter *ObjectLookupIter) ForEach(cb func(Object) error) error { defer iter.Close() for _, hash := range iter.series { - obj, err := iter.storage.Get(hash, AnyObject) + obj, err := iter.storage.Get(AnyObject, hash) if err != nil { return err } diff --git a/core/storage.go b/core/storage.go index f3ec52b..15d988a 100644 --- a/core/storage.go +++ b/core/storage.go @@ -18,7 +18,7 @@ type ObjectStorage interface { // and AnyObject. // // If AnyObject is given, the object must be looked up regardless of its type. - Get(Hash, ObjectType) (Object, error) + Get(ObjectType, Hash) (Object, error) Iter(ObjectType) (ObjectIter, error) } |