Use references when it's possible and other small enhancements.#198
Merged
pavel-shirshov merged 8 commits intosonic-net:masterfrom May 2, 2018
Merged
Use references when it's possible and other small enhancements.#198pavel-shirshov merged 8 commits intosonic-net:masterfrom
pavel-shirshov merged 8 commits intosonic-net:masterfrom
Conversation
Contributor
pavel-shirshov
commented
May 1, 2018
- Use references as loop arguments
- Initialize class fields in initializer list
- Don't use std::move for return value
- Don't use compare method to compare two strings for equality
- Fix typo
qiluo-msft
reviewed
May 1, 2018
| @@ -101,13 +101,13 @@ static inline std::set<std::string> runRedisScript(DBConnector &db, const std::s | |||
| if (ctx->type == REDIS_REPLY_NIL) | |||
Contributor
There was a problem hiding this comment.
if [](start = 8, length = 2)
if (ctx->type == REDIS_REPLY_NIL)
{
SWSS_LOG_ERROR("Got EMPTY response type from redis %d", ctx->type);
}
else if (ctx->type != REDIS_REPLY_ARRAY)
{
SWSS_LOG_ERROR("Got invalid response type from redis %d", ctx->type);
}
else
{
for (size_t i = 0; i < ctx->elements; i++)
{
SWSS_LOG_DEBUG("Got element %lu %s", i, ctx->element[i]->str);
ret.insert(ctx->element[i]->str);
}
}
return ret;
Contributor
Author
There was a problem hiding this comment.
I don't see any comments here
Contributor
There was a problem hiding this comment.
I believe Qi is presenting a refactored, simplified block of code to replace the entire block with. Note only one return statement. Not so much a comment, but rather a suggested replacement.
qiluo-msft
approved these changes
May 1, 2018
jleveque
approved these changes
May 1, 2018
prgeor
pushed a commit
to prgeor/sonic-swss-common
that referenced
this pull request
Feb 27, 2025
…t#198) sonic-config-engine now depends on sonic-yang-mgmt and sonic-yang-models, so we now need to install them as part of continuous integration to get the CI working again
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.