-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: cleanup `len' usage #5956
Conversation
@TheRealFalcon @blackboxsw PTAL and let me what you think of this. |
@TheRealFalcon gentle reminder on this. If you think this is a big change for little gain, please let me know; I will close this PR. |
@sshedi , sorry, I've been busy with some other priorities. It is a big change, but I think it's probably worthwhile. I just need to get some time to review. |
No rush at all—I just wanted to check if this change is worth making. Sorry to bother you, and thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sshedi , the changes here generally look good to me. I left some inline comments
In most cases there is need to calculate length of list of string values to do something else, just ensuring list or string is not empty is enough. This will also give a slight performance gain. Signed-off-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks @sshedi
In most cases there is no need to calculate length of list of string values to do something else, just ensuring list or string is not empty is enough. This will also give a slight performance gain. Signed-off-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
In most cases there is no need to calculate length of list of string values to do something else, just ensuring list or string is not empty is enough. This will also give a slight performance gain. Signed-off-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
In most cases there is need to calculate length of list of string values to do something else, just ensuring list or string is not empty is enough. This will also give a slight performance gain.
Proposed Commit Message
Merge type