From 4a9952978a3c09a22385478393394f40b99e32cf Mon Sep 17 00:00:00 2001 From: LK4D4 Date: Sat, 28 Jun 2014 12:27:44 +0400 Subject: [PATCH] Increase patricia.MaxPrefixPerNode It allows to avoid redundant prefix splits Docker-DCO-1.1-Signed-off-by: Alexandr Morozov (github: LK4D4) Upstream-commit: 095cb7a81800512b99474aec7245bddddd1b2278 Component: engine --- components/engine/pkg/truncindex/truncindex.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/engine/pkg/truncindex/truncindex.go b/components/engine/pkg/truncindex/truncindex.go index 811f606661..89aa88d6b7 100644 --- a/components/engine/pkg/truncindex/truncindex.go +++ b/components/engine/pkg/truncindex/truncindex.go @@ -13,6 +13,12 @@ var ( ErrNoID = errors.New("prefix can't be empty") ) +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. // This is used to retrieve image and container IDs by more convenient shorthand prefixes. type TruncIndex struct {