From 6c6db7bcc59788a5d525bd74fe4e8aac8e7f58bf Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sat, 17 Aug 2024 07:06:30 +0200 Subject: [PATCH] llama : std::move llm_bigram_bpe from work_queue This commit updates the retrieval of llm_bigram_bpe objects from work_queue.top() by using std::move. The motivation for this is to avoid the copying of the std::string `text` member of the llm_bigram_bpe struct. --- src/llama-vocab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp index 17deefaa8..5abe6b3fd 100644 --- a/src/llama-vocab.cpp +++ b/src/llama-vocab.cpp @@ -520,7 +520,7 @@ struct llm_tokenizer_bpe { // build token(s) while (!work_queue.empty()) { - auto bigram = work_queue.top(); + auto bigram = std::move(const_cast(work_queue.top())); work_queue.pop(); auto & left_symbol = symbols[bigram.left];