Replace resize with possible negative range with pop_back() (#189)

This commit is contained in:
Jerin Philip 2021-06-05 00:28:53 +01:00 committed by GitHub
parent 71a62405e7
commit d39e0277c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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