From 188501a333451b4765a4660d8ce11796b3a07b7c Mon Sep 17 00:00:00 2001 From: godeffroy Date: Thu, 17 Sep 2020 19:10:43 +0200 Subject: [PATCH] PR #3279 - Reverted unrelated and unwanted change. --- native_client/ctcdecode/ctc_beam_search_decoder.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/native_client/ctcdecode/ctc_beam_search_decoder.cpp b/native_client/ctcdecode/ctc_beam_search_decoder.cpp index 3d4121558a..564ca60a93 100644 --- a/native_client/ctcdecode/ctc_beam_search_decoder.cpp +++ b/native_client/ctcdecode/ctc_beam_search_decoder.cpp @@ -235,14 +235,13 @@ DecoderState::decode(size_t num_results) const std::vector outputs; outputs.reserve(num_returned); - for (PathTrie* prefix : prefixes_copy) { + for (size_t i = 0; i < num_returned; ++i) { Output output; - prefix->get_path_vec(output.tokens); - output.timesteps = get_history(prefix->timesteps, ×tep_tree_root_); + prefixes_copy[i]->get_path_vec(output.tokens); + output.timesteps = get_history(prefixes_copy[i]->timesteps, ×tep_tree_root_); assert(output.tokens.size() == output.timesteps.size()); - output.confidence = scores[prefix]; + output.confidence = scores[prefixes_copy[i]]; outputs.push_back(output); - if (outputs.size() >= num_returned) break; } return outputs;