mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-08-15 16:40:26 +03:00
Replace resize with possible negative range with pop_back() (#189)
This commit is contained in:
parent
71a62405e7
commit
d39e0277c6
@ -47,7 +47,7 @@ void AnnotatedText::recordExistingSentence(std::vector<string_view>::iterator be
|
||||
assert(!annotation.token_begin_.empty());
|
||||
assert(annotation.token_begin_.back() == text.size());
|
||||
// Clip off size token ending.
|
||||
annotation.token_begin_.resize(annotation.token_begin_.size() - 1);
|
||||
annotation.token_begin_.pop_back();
|
||||
for (std::vector<string_view>::iterator i = begin; i != end; ++i) {
|
||||
assert(i->data() >= text.data()); // In range.
|
||||
assert(i->data() + i->size() <= text.data() + text.size()); // In range
|
||||
|
Loading…
Reference in New Issue
Block a user