// collectIntentSpans collects the spans of the intents to be resolved for the // transaction. It does not create copies, so the caller must not alter the // returned data. Usually called with txnMeta.keys. func collectIntentSpans(keys interval.RangeGroup) []roachpb.Span { intents := make([]roachpb.Span, 0, keys.Len()) if err := keys.ForEach(func(r interval.Range) error { sp := roachpb.Span{ Key: roachpb.Key(r.Start), } if endKey := roachpb.Key(r.End); !sp.Key.IsPrev(endKey) { sp.EndKey = endKey } intents = append(intents, sp) return nil }); err != nil { panic(err) } return intents }