Skip to content

Commit

Permalink
Add noreturn
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <[email protected]>
  • Loading branch information
Pterosaur committed Nov 24, 2023
1 parent 8a087c0 commit d289a9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions common/redisreply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@ string RedisReply::formatTupleReply(struct redisReply **element, size_t elements
return swss::join(", ", '(', ')', elementvector.begin(), elementvector.end());
}

#ifndef DASH_API_INSTALLED
[[noreturn]]
#endif
string RedisReply::formatPbReply(struct redisReply **element, size_t elements, const string &key)
{
#ifdef DASH_API_INSTALLED
Expand All @@ -530,9 +533,9 @@ string RedisReply::formatPbReply(struct redisReply **element, size_t elements, c
[](char c){ return c == ':' || c == '|';}));

return dash::PbBinaryToJsonString(table_name, pb_buffer);
#endif
#else
throw runtime_error("Dash API is not installed");
return "";
#endif
}

string RedisReply::formatStringWithQuot(const string &str)
Expand Down
1 change: 0 additions & 1 deletion common/redisreply.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <hiredis/hiredis.h>
#include <string>
#include <stdexcept>

#include "rediscommand.h"

namespace swss {
Expand Down

0 comments on commit d289a9f

Please sign in to comment.