Skip to content

Commit

Permalink
Replace boost::to_lower with ToLower
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Aug 7, 2021
1 parent cf4d321 commit 3b07405
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/gridcoin/researcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool UpdateRWSettingsForMode(const ResearcherMode mode, const std::string& email
//!
std::string LowerUnderscore(std::string data)
{
boost::to_lower(data);
data = ToLower(data);
boost::replace_all(data, "_", " ");

return data;
Expand Down Expand Up @@ -304,7 +304,7 @@ std::set<std::string> GetTeamWhitelist()
continue;
}

boost::to_lower(team_name);
team_name = ToLower(team_name);

teams.emplace(std::move(team_name));
}
Expand Down Expand Up @@ -794,7 +794,7 @@ MiningProject::MiningProject(std::string name,
, m_rac(std::move(rac))
, m_error(Error::NONE)
{
boost::to_lower(m_team);
m_team = ToLower(m_team);
}

MiningProject MiningProject::Parse(const std::string& xml)
Expand Down Expand Up @@ -1106,7 +1106,7 @@ std::string Researcher::Email()
if (gArgs.GetBoolArg("-investor", false)) return email;

email = gArgs.GetArg("-email", "");
boost::to_lower(email);
email = ToLower(email);

return email;
}
Expand Down Expand Up @@ -1353,7 +1353,7 @@ GRC::BeaconError Researcher::BeaconError() const

bool Researcher::ChangeMode(const ResearcherMode mode, std::string email)
{
boost::to_lower(email);
email = ToLower(email);

if (mode == ResearcherMode::INVESTOR && ConfiguredForInvestorMode()) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/gridcoin/upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool Upgrade::CheckForLatestUpdate(std::string& client_message_out, bool ui_dial
return false;
}

boost::to_lower(GithubReleaseTypeData);
GithubReleaseTypeData = ToLower(GithubReleaseTypeData);
if (GithubReleaseTypeData.find("leisure") != std::string::npos)
GithubReleaseType = _("leisure");

Expand Down
4 changes: 2 additions & 2 deletions src/gridcoin/voting/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace {
std::string ParseLegacyVoteTitle(const std::string& key)
{
std::string title = key.substr(0, key.find(';'));
boost::to_lower(title);
title = ToLower(title);

return title;
}
Expand Down Expand Up @@ -801,7 +801,7 @@ void PollRegistry::AddPoll(const ContractContext& ctx)
// The title used as the key for the m_poll map keyed by title, and also checked for duplicates, should
// not be case-sensitive, regardless of whether v1 or v2+. We should not be allowing the insertion of two v2 polls
// with the same title except for a difference in case.
boost::to_lower(poll_title);
poll_title = ToLower(poll_title);

auto result_pair = m_polls.emplace(std::move(poll_title), PollReference());

Expand Down
2 changes: 1 addition & 1 deletion src/gridcoin/voting/result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ class LegacyVoteCounterContext
if (m_legacy_choices_cache.empty()) {
for (uint8_t i = 0; i < m_poll.Choices().size(); ++i) {
std::string label = m_poll.Choices().At(i)->m_label;
boost::to_lower(label);
label = ToLower(label);

m_legacy_choices_cache.emplace(std::move(label), i);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gridcoin/voting/vote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ LegacyVote::ParseResponses(const std::map<std::string, uint8_t>& choice_map) con
std::vector<std::pair<uint8_t, uint64_t>> responses;

for (auto& answer : answers) {
boost::to_lower(answer);
answer = ToLower(answer);

auto iter = choice_map.find(answer);

Expand Down
2 changes: 1 addition & 1 deletion src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool fNameLookup = false;
static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };

enum Network ParseNetwork(std::string net) {
boost::to_lower(net);
net = ToLower(net);
if (net == "ipv4") return NET_IPV4;
if (net == "ipv6") return NET_IPV6;
if (net == "tor") return NET_TOR;
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int ReadHTTPHeaders(std::basic_istream<char>& stream, std::map<std::string, std:
{
std::string strHeader = str.substr(0, nColon);
boost::trim(strHeader);
boost::to_lower(strHeader);
strHeader = ToLower(strHeader);
std::string strValue = str.substr(nColon+1);
boost::trim(strValue);
mapHeadersRet[strHeader] = strValue;
Expand Down

0 comments on commit 3b07405

Please sign in to comment.