Remove unnecessary copies of errorCodeTable

This commit is contained in:
sfc-gh-tclinkenbeard 2020-10-20 15:55:23 -07:00
parent 73e77f31eb
commit c4fc36ed23
1 changed files with 2 additions and 2 deletions

View File

@ -107,14 +107,14 @@ ErrorCodeTable& Error::errorCodeTable() {
}
const char* Error::name() const {
auto table = errorCodeTable();
const auto& table = errorCodeTable();
auto it = table.find(error_code);
if (it == table.end()) return "UNKNOWN_ERROR";
return it->second.first;
}
const char* Error::what() const {
auto table = errorCodeTable();
const auto& table = errorCodeTable();
auto it = table.find(error_code);
if (it == table.end()) return "UNKNOWN_ERROR";
return it->second.second;