Do not create single element list if only one candidate
This commit is contained in:
committed by
Mikhail Glukhikh
parent
f434248cb7
commit
dfd0042a5b
@@ -900,6 +900,7 @@ open class CandidateCollector(val components: InferenceComponents) {
|
|||||||
|
|
||||||
fun bestCandidates(): List<Candidate> {
|
fun bestCandidates(): List<Candidate> {
|
||||||
if (groupNumbers.isEmpty()) return emptyList()
|
if (groupNumbers.isEmpty()) return emptyList()
|
||||||
|
if (groupNumbers.size == 1) return candidates
|
||||||
val result = mutableListOf<Candidate>()
|
val result = mutableListOf<Candidate>()
|
||||||
var bestGroup = groupNumbers.first()
|
var bestGroup = groupNumbers.first()
|
||||||
for ((index, candidate) in candidates.withIndex()) {
|
for ((index, candidate) in candidates.withIndex()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user