···163163 // Exclude compound shards from being merge targets. Why? We want repositories in a
164164 // compound shard to be ordered based on their priority. The easiest way to
165165 // enforce this is to delete the compound shard once it drops below a certain
166166- // size (handeled by cleanup), reindex the repositories and merge them with other
166166+ // size (handled by cleanup), reindex the repositories and merge them with other
167167 // shards in the correct order.
168168 if len(repos) > 1 {
169169 return true
+1-1
ngramoffset.go
···1818 "sort"
1919)
20202121-// shrinkUint32Slice copies slices with excess capacity to precisely seized ones
2121+// shrinkUint32Slice copies slices with excess capacity to precisely sized ones
2222// to avoid wasting memory. It should be used on slices with long static durations.
2323func shrinkUint32Slice(a []uint32) []uint32 {
2424 if cap(a)-len(a) < 32 {
-29
section_test.go
···11-// Copyright 2016 Google Inc. All rights reserved.
22-//
33-// Licensed under the Apache License, Version 2.0 (the "License");
44-// you may not use this file except in compliance with the License.
55-// You may obtain a copy of the License at
66-//
77-// http://www.apache.org/licenses/LICENSE-2.0
88-//
99-// Unless required by applicable law or agreed to in writing, software
1010-// distributed under the License is distributed on an "AS IS" BASIS,
1111-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212-// See the License for the specific language governing permissions and
1313-// limitations under the License.
1414-1515-package zoekt
1616-1717-import (
1818- "reflect"
1919- "testing"
2020-)
2121-2222-func TestDeltas(t *testing.T) {
2323- in := []uint32{1, 72, 0xfff}
2424- out := toSizedDeltas(in)
2525- round := fromSizedDeltas(out, nil)
2626- if !reflect.DeepEqual(in, round) {
2727- t.Errorf("got %v, want %v", round, in)
2828- }
2929-}
-1
stream/stream.go
···7575 }
7676 }()
77777878- // mu protects aggStats and concurrent writes to the stream.
7978 aggStats := zoekt.Stats{}
8079 send := func(zsr *zoekt.SearchResult) {
8180 err := eventWriter.event(eventMatches, zsr)