Update go-patricia to 2.1.0
This includes a fix for the minor v2 API change introduced by 341a37095f
. 👍
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
This commit is contained in:
parent
d05398f1e9
commit
ff0cdf0b19
1 changed files with 5 additions and 8 deletions
|
@ -14,12 +14,6 @@ var (
|
||||||
ErrAmbiguousPrefix = errors.New("Multiple IDs found with provided prefix")
|
ErrAmbiguousPrefix = errors.New("Multiple IDs found with provided prefix")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
// Change patricia max prefix per node length,
|
|
||||||
// because our len(ID) always 64
|
|
||||||
patricia.MaxPrefixPerNode = 64
|
|
||||||
}
|
|
||||||
|
|
||||||
// TruncIndex allows the retrieval of string identifiers by any of their unique prefixes.
|
// TruncIndex allows the retrieval of string identifiers by any of their unique prefixes.
|
||||||
// This is used to retrieve image and container IDs by more convenient shorthand prefixes.
|
// This is used to retrieve image and container IDs by more convenient shorthand prefixes.
|
||||||
type TruncIndex struct {
|
type TruncIndex struct {
|
||||||
|
@ -31,8 +25,11 @@ type TruncIndex struct {
|
||||||
// NewTruncIndex creates a new TruncIndex and initializes with a list of IDs
|
// NewTruncIndex creates a new TruncIndex and initializes with a list of IDs
|
||||||
func NewTruncIndex(ids []string) (idx *TruncIndex) {
|
func NewTruncIndex(ids []string) (idx *TruncIndex) {
|
||||||
idx = &TruncIndex{
|
idx = &TruncIndex{
|
||||||
ids: make(map[string]struct{}),
|
ids: make(map[string]struct{}),
|
||||||
trie: patricia.NewTrie(),
|
|
||||||
|
// Change patricia max prefix per node length,
|
||||||
|
// because our len(ID) always 64
|
||||||
|
trie: patricia.NewTrie(patricia.MaxPrefixPerNode(64)),
|
||||||
}
|
}
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
idx.addID(id)
|
idx.addID(id)
|
||||||
|
|
Loading…
Reference in a new issue