Skip to content

Commit

Permalink
Use template hgetall, because we will tune the return types of librar…
Browse files Browse the repository at this point in the history
…y functions (sonic-net#759)

The template version of hgetall() could work with either map or unordered_map.
  • Loading branch information
qiluo-msft authored Jan 4, 2021
1 parent a8ec0ed commit 0cfe091
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion syncd/RedisClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,9 @@ std::unordered_map<std::string, std::string> RedisClient::getAttributesFromAsicK
{
SWSS_LOG_ENTER();

return m_dbAsic->hgetall(key);
std::unordered_map<std::string, std::string> map;
m_dbAsic->hgetall(key, std::inserter(map, map.end()));
return map;
}

bool RedisClient::hasNoHiddenKeysDefined() const
Expand Down

0 comments on commit 0cfe091

Please sign in to comment.