Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
y5nw committed Mar 30, 2024
1 parent 1c32878 commit e0844bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,7 @@ void Server::sendMediaAnnouncement(session_t peer_id, const std::string &lang_co
if (info.no_announce)
return false;
if (str_ends_with(name, ".tr")) {
for (auto lang: lang_list) {
for (const auto &lang: lang_list) {
std::string suffix = "." + lang + ".tr";
if (str_ends_with(name, suffix))
return true;
Expand Down
8 changes: 4 additions & 4 deletions src/translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ void Translations::clear()
m_translations->clear();
}

const std::wstring &Translations::getTranslation(
const std::vector<std::wstring> &languages, const std::wstring &textdomain, const std::wstring &s)
const std::wstring &Translations::getTranslation(const std::vector<std::wstring> &languages,
const std::wstring &textdomain, const std::wstring &s) const
{
for (auto language: languages) {
for (const auto &language: languages) {
std::wstring key = INDEX(language, textdomain, s);
auto it = m_translations->find(key);
if (it != m_translations->end())
Expand All @@ -54,7 +54,7 @@ const std::wstring &Translations::getTranslation(
}

const std::wstring &Translations::getTranslation(
const std::wstring &textdomain, const std::wstring &s)
const std::wstring &textdomain, const std::wstring &s) const
{
return getTranslation(m_preferred_languages, textdomain, s);
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/langcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static std::string find_tr_language(const std::string &code)
std::vector<std::string> get_tr_language(const std::vector<std::string> &languages)
{
std::vector<std::string> list;
for (auto language: languages) {
for (const auto &language: languages) {
std::string tr_lang = find_tr_language(language);
if (!tr_lang.empty())
list.push_back(std::move(tr_lang));
Expand Down

0 comments on commit e0844bf

Please sign in to comment.