@@ -89,14 +89,13 @@ type PodCache struct {
89
89
// If the podIdentifierSet is empty, all pods are returned.
90
90
//
91
91
// It returns:
92
- // 1. A slice of the hit keys.
93
- // 2. A map where the keys are those in (1) and the values are pod-identifiers.
94
- // 3. An error if any occurred during the operation.
92
+ // 1. A map where the keys are those in (1) and the values are pod-identifiers.
93
+ // 2. An error if any occurred during the operation.
95
94
func (m * InMemoryIndex ) Lookup (ctx context.Context , keys []Key ,
96
95
podIdentifierSet sets.Set [string ],
97
- ) ([] Key , map [Key ][]string , error ) {
96
+ ) (map [Key ][]string , error ) {
98
97
if len (keys ) == 0 {
99
- return nil , nil , fmt .Errorf ("no keys provided for lookup" )
98
+ return nil , fmt .Errorf ("no keys provided for lookup" )
100
99
}
101
100
102
101
traceLogger := klog .FromContext (ctx ).V (logging .TRACE ).WithName ("kvblock.InMemoryIndex.Lookup" )
@@ -108,7 +107,7 @@ func (m *InMemoryIndex) Lookup(ctx context.Context, keys []Key,
108
107
if pods , found := m .data .Get (key ); found { //nolint:nestif // TODO: can this be optimized?
109
108
if pods == nil || pods .cache .Len () == 0 {
110
109
traceLogger .Info ("no pods found for key, cutting search" , "key" , key )
111
- return keys [: idx ], podsPerKey , nil // early stop since prefix-chain breaks here
110
+ return podsPerKey , nil // early stop since prefix-chain breaks here
112
111
}
113
112
114
113
highestHitIdx = idx
@@ -135,7 +134,7 @@ func (m *InMemoryIndex) Lookup(ctx context.Context, keys []Key,
135
134
traceLogger .Info ("lookup completed" , "highest-hit-index" , highestHitIdx ,
136
135
"pods-per-key" , podsPerKeyPrintHelper (podsPerKey ))
137
136
138
- return keys [: highestHitIdx + 1 ], podsPerKey , nil
137
+ return podsPerKey , nil
139
138
}
140
139
141
140
// Add adds a set of keys and their associated pod entries to the index backend.
0 commit comments