MassManager: return empty_string by ref instead of a temp object.
This commit is contained in:
parent
4e1a74e03e
commit
685bc59540
2 changed files with 3 additions and 3 deletions
|
@ -241,7 +241,7 @@ auto MassManager::stagedMasses() -> std::map<std::string, std::string> const& {
|
||||||
return _stagedMasses;
|
return _stagedMasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto MassManager::stagedMassName(int index) -> std::string {
|
auto MassManager::stagedMassName(int index) -> std::string const& {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(const auto& mass_info : _stagedMasses) {
|
for(const auto& mass_info : _stagedMasses) {
|
||||||
if(i != index) {
|
if(i != index) {
|
||||||
|
@ -252,7 +252,7 @@ auto MassManager::stagedMassName(int index) -> std::string {
|
||||||
return mass_info.second;
|
return mass_info.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::string{""};
|
return empty_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto MassManager::updateStagedMass(const std::string& filename) -> int {
|
auto MassManager::updateStagedMass(const std::string& filename) -> int {
|
||||||
|
|
|
@ -49,7 +49,7 @@ class MassManager {
|
||||||
|
|
||||||
auto stagedMasses() -> std::map<std::string, std::string> const&;
|
auto stagedMasses() -> std::map<std::string, std::string> const&;
|
||||||
|
|
||||||
auto stagedMassName(int index) -> std::string;
|
auto stagedMassName(int index) -> std::string const&;
|
||||||
|
|
||||||
auto updateStagedMass(const std::string& filename) -> int;
|
auto updateStagedMass(const std::string& filename) -> int;
|
||||||
auto removeStagedMass(const std::string& filename) -> int;
|
auto removeStagedMass(const std::string& filename) -> int;
|
||||||
|
|
Loading…
Reference in a new issue