refactor: X11LayoutParser:appendVectorUniq, capture elem by ref in our lambda
This commit is contained in:
parent
43b1014700
commit
a9d518fbc8
1 changed files with 1 additions and 1 deletions
|
|
@ -95,7 +95,7 @@ std::vector<X11LayoutsParser::Lang> X11LayoutsParser::getAllLanguageData(const s
|
||||||
void X11LayoutsParser::appendVectorUniq(const std::vector<std::string> &source, std::vector<std::string> &dst)
|
void X11LayoutsParser::appendVectorUniq(const std::vector<std::string> &source, std::vector<std::string> &dst)
|
||||||
{
|
{
|
||||||
for (const auto &elem : source) {
|
for (const auto &elem : source) {
|
||||||
if (std::ranges::find_if(dst, [elem](const std::string_view &s) { return s == elem; }) == dst.end()) {
|
if (std::ranges::find_if(dst, [&elem](const std::string_view &s) { return s == elem; }) == dst.end()) {
|
||||||
dst.push_back(elem);
|
dst.push_back(elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue