-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[core] Minor update on runtime env manager #48916
[core] Minor update on runtime env manager #48916
Conversation
Signed-off-by: hjiang <[email protected]>
for (const auto &uri : iter->second) { | ||
auto uri_ref_iter = uri_reference_.find(uri); | ||
RAY_CHECK(uri_ref_iter != uri_reference_.end()); | ||
const auto new_ref_count = --uri_ref_iter->second; |
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.
I don't like -- and ++ with assignments. Let's put it 2 lines
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.
I don't like -- and ++ with assignments
Any reasoning? Coding practice / suggestion?
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.
code readability. when I read
auto y = ++x;
I need to reason: okay so y is assigned to the value before increment, not after.
but when I read
auto y = x;
++x;
there's no such cognitive load.
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.
wait I even made a mistake, it's after the increment not before lol. this really makes the point.
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.
I think this is fundamental C/C++ grammar, not something fancy and hard-to-understand.
But updated to make you happy.
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
No description provided.