File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,14 @@ import "slices"
1313//
1414// Returns true iff all of the spans are distinct.
1515// The input spans are not safe for re-use.
16- func mergeSpans (latches * []Span ) ([]Span , bool ) {
17- if len (* latches ) == 0 {
18- return * latches , true
16+ func mergeSpans (latches []Span ) ([]Span , bool ) {
17+ if len (latches ) == 0 {
18+ return latches , true
1919 }
2020
2121 // Sort first on the start key and second on the end key. Note that we're
2222 // relying on empty EndKey sorting before other EndKeys.
23- slices .SortFunc (* latches , func (s1 , s2 Span ) int {
23+ slices .SortFunc (latches , func (s1 , s2 Span ) int {
2424 if c := s1 .Key .Compare (s2 .Key ); c != 0 {
2525 return c
2626 }
@@ -30,10 +30,10 @@ func mergeSpans(latches *[]Span) ([]Span, bool) {
3030 // We build up the resulting slice of merged spans in place. This is safe
3131 // because "r" grows by at most 1 element on each iteration, staying abreast
3232 // or behind the iteration over "latches".
33- r := ( * latches ) [:1 ]
33+ r := latches [:1 ]
3434 distinct := true
3535
36- for _ , cur := range ( * latches ) [1 :] {
36+ for _ , cur := range latches [1 :] {
3737 prev := & r [len (r )- 1 ]
3838 if len (cur .EndKey ) == 0 && len (prev .EndKey ) == 0 {
3939 if cur .Key .Compare (prev .Key ) != 0 {
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ func (s *SpanSet) Merge(s2 *SpanSet) {
216216func (s * SpanSet ) SortAndDedup () {
217217 for sa := SpanAccess (0 ); sa < NumSpanAccess ; sa ++ {
218218 for ss := SpanScope (0 ); ss < NumSpanScope ; ss ++ {
219- s.spans [sa ][ss ], _ /* distinct */ = mergeSpans (& s.spans [sa ][ss ])
219+ s.spans [sa ][ss ], _ /* distinct */ = mergeSpans (s.spans [sa ][ss ])
220220 }
221221 }
222222}
You can’t perform that action at this time.
0 commit comments