From d39e0277c6d19e86401ed599000b08db9c721a95 Mon Sep 17 00:00:00 2001 From: Jerin Philip Date: Sat, 5 Jun 2021 00:28:53 +0100 Subject: [PATCH] Replace resize with possible negative range with pop_back() (#189) --- src/translator/annotation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translator/annotation.cpp b/src/translator/annotation.cpp index 94ceb54..e05a6a7 100644 --- a/src/translator/annotation.cpp +++ b/src/translator/annotation.cpp @@ -47,7 +47,7 @@ void AnnotatedText::recordExistingSentence(std::vector::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::iterator i = begin; i != end; ++i) { assert(i->data() >= text.data()); // In range. assert(i->data() + i->size() <= text.data() + text.size()); // In range