X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FThesaurus.cpp;h=1c1adc03b0e22cb91154ac21e396957b05997bb3;hb=3bf1b97a;hp=ace03d79e9b4014db7ec26c4938a4242f114365a;hpb=196d9caeb0b9f74d02750f774de1ca63a483803f;p=features.git diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp index ace03d79e9..1c1adc03b0 100644 --- a/src/Thesaurus.cpp +++ b/src/Thesaurus.cpp @@ -217,7 +217,7 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl) MyThes * mythes = nullptr; docstring const lang_code = from_ascii(wl.lang()->code()); - docstring const t = wl.word(); + docstring const & t = wl.word(); if (!d->addThesaurus(lang_code)) return meanings; @@ -266,6 +266,7 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl) // remove silly item if (support::prefixIs(meaning, '-')) meaning = support::ltrim(meaning, "- "); + ret.reserve(pm->count); for (int j = 0; j < pm->count; j++) { ret.push_back(from_iconv_encoding(string(pm->psyns[j]), encoding)); }