mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:00:05 +00:00
Return fields by value instead of const reference
This commit is contained in:
parent
c47a569645
commit
835ee644b5
10 changed files with 481 additions and 483 deletions
|
|
@ -47,14 +47,13 @@ const std::string& GetProductGroupName(RadarProductGroup group)
|
|||
return productGroupName_.at(group);
|
||||
}
|
||||
|
||||
const RadarProductGroup GetProductGroup(const std::string& name)
|
||||
RadarProductGroup GetProductGroup(const std::string& name)
|
||||
{
|
||||
auto result = std::find_if(
|
||||
productGroupName_.cbegin(),
|
||||
productGroupName_.cend(),
|
||||
[&](const std::pair<RadarProductGroup, std::string>& pair) -> bool {
|
||||
return pair.second == name;
|
||||
});
|
||||
[&](const std::pair<RadarProductGroup, std::string>& pair) -> bool
|
||||
{ return pair.second == name; });
|
||||
|
||||
if (result != productGroupName_.cend())
|
||||
{
|
||||
|
|
@ -81,14 +80,13 @@ const std::string& GetLevel2Palette(Level2Product product)
|
|||
return level2Palette_.at(product);
|
||||
}
|
||||
|
||||
const Level2Product GetLevel2Product(const std::string& name)
|
||||
Level2Product GetLevel2Product(const std::string& name)
|
||||
{
|
||||
auto result = std::find_if(
|
||||
level2Name_.cbegin(),
|
||||
level2Name_.cend(),
|
||||
[&](const std::pair<Level2Product, std::string>& pair) -> bool {
|
||||
return pair.second == name;
|
||||
});
|
||||
[&](const std::pair<Level2Product, std::string>& pair) -> bool
|
||||
{ return pair.second == name; });
|
||||
|
||||
if (result != level2Name_.cend())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue