Tighten evidence context source excerpts
This commit is contained in:
@@ -44,7 +44,11 @@ func Build(request BuildRequest) (Document, error) {
|
||||
}
|
||||
|
||||
merged := mergeRanges(ranges)
|
||||
document := make(Document, 0)
|
||||
unitCount := 0
|
||||
for _, value := range merged {
|
||||
unitCount += value.endPos - value.startPos + 1
|
||||
}
|
||||
document := make(Document, 0, unitCount)
|
||||
for _, value := range merged {
|
||||
for position := value.startPos; position <= value.endPos; position++ {
|
||||
unit, err := cloneSourceUnit(request.Source.Units[position])
|
||||
|
||||
Reference in New Issue
Block a user