vendor: update containers/storage to latest
using github.com/LK4D4/vndr, but then trimming all vendored packages that had changed, back to only containers/storage. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
8ea79e755f
commit
72d480c8c0
9 changed files with 78 additions and 79 deletions
12
vendor/github.com/containers/storage/pkg/truncindex/truncindex.go
generated
vendored
12
vendor/github.com/containers/storage/pkg/truncindex/truncindex.go
generated
vendored
|
@ -77,10 +77,7 @@ func (idx *TruncIndex) addID(id string) error {
|
|||
func (idx *TruncIndex) Add(id string) error {
|
||||
idx.Lock()
|
||||
defer idx.Unlock()
|
||||
if err := idx.addID(id); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return idx.addID(id)
|
||||
}
|
||||
|
||||
// Delete removes an ID from the TruncIndex. If there are multiple IDs
|
||||
|
@ -128,8 +125,13 @@ func (idx *TruncIndex) Get(s string) (string, error) {
|
|||
return "", ErrNotExist
|
||||
}
|
||||
|
||||
// Iterate iterates over all stored IDs, and passes each of them to the given handler.
|
||||
// Iterate iterates over all stored IDs and passes each of them to the given
|
||||
// handler. Take care that the handler method does not call any public
|
||||
// method on truncindex as the internal locking is not reentrant/recursive
|
||||
// and will result in deadlock.
|
||||
func (idx *TruncIndex) Iterate(handler func(id string)) {
|
||||
idx.Lock()
|
||||
defer idx.Unlock()
|
||||
idx.trie.Visit(func(prefix patricia.Prefix, item patricia.Item) error {
|
||||
handler(string(prefix))
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue