Skip to content
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

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Nov 25, 2024

No description provided.

src/ray/common/runtime_env_manager.cc Outdated Show resolved Hide resolved
src/ray/common/runtime_env_manager.cc Outdated Show resolved Hide resolved
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;
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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]>
@dentiny dentiny added the go add ONLY when ready to merge, run all tests label Nov 25, 2024
@jjyao jjyao merged commit 2ae9aa7 into ray-project:master Nov 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants