Skip to content

Commit a70f34b

Browse files
author
Hang Lyu
committed
minor fix
1 parent d7a3a9d commit a70f34b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/decoder/lattice-faster-decoder-combine-bucketqueue.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ template<typename Token>
4343
void BucketQueue<Token>::Push(Token *tok) {
4444
int32 bucket_index = std::floor(tok->tot_cost * cost_scale_);
4545
size_t vec_index = static_cast<size_t>(bucket_index - bucket_storage_begin_);
46-
4746
if (vec_index >= buckets_.size()) {
4847
int32 margin = 10; // a margin which is used to reduce re-allocate
4948
// space frequently
@@ -63,7 +62,8 @@ void BucketQueue<Token>::Push(Token *tok) {
6362
buckets_[i].swap(buckets_[i - increase_size]);
6463
}
6564
bucket_storage_begin_ = bucket_storage_begin_ - increase_size;
66-
vec_index = increase_size;
65+
vec_index = static_cast<int32>(vec_index) + increase_size;
66+
first_occupied_vec_index_ = vec_index;
6767
}
6868
}
6969
tok->in_queue = true;

src/decoder/lattice-faster-decoder-combine.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ template<typename Token>
4343
void BucketQueue<Token>::Push(Token *tok) {
4444
int32 bucket_index = std::floor(tok->tot_cost * cost_scale_);
4545
size_t vec_index = static_cast<size_t>(bucket_index - bucket_storage_begin_);
46-
4746
if (vec_index >= buckets_.size()) {
4847
int32 margin = 10; // a margin which is used to reduce re-allocate
4948
// space frequently
@@ -63,7 +62,8 @@ void BucketQueue<Token>::Push(Token *tok) {
6362
buckets_[i].swap(buckets_[i - increase_size]);
6463
}
6564
bucket_storage_begin_ = bucket_storage_begin_ - increase_size;
66-
vec_index = increase_size;
65+
vec_index = static_cast<int32>(vec_index) + increase_size;
66+
first_occupied_vec_index_ = vec_index;
6767
}
6868
}
6969
tok->in_queue = true;

0 commit comments

Comments
 (0)