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

[CM] Better readability and maintainability: rename variables, move code to more logical places 🔧 #1227

Merged
merged 3 commits into from
Jan 20, 2024

Conversation

destogl
Copy link
Member

@destogl destogl commented Dec 18, 2023

  • Move 'manage_switch' method and 'do_switch' flag to more appropriate positions.
  • Make variable name clearer: rename 'request' to 'controller_name'.

@destogl destogl self-assigned this Dec 18, 2023
@bmagyar bmagyar changed the title [CM] Better readability and maintability: rename varialbes, move code to more logical places 🔧 [CM] Better readability and maintainability: rename variables, move code to more logical places 🔧 Dec 18, 2023
}

if (controller->is_async())
{
async_controller_threads_.at(controller_name)->activate();
}
}
// All controllers activated, switching done
switch_params_.do_switch = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changes behaviour, nicht wahr?

I see it was moved into manage_switch() to the end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it should not change behavior, but just put it in a more logical place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually here it might be wrong. Because the "switching" is not (theoretically( finished here if one add something more to the mange_switch method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what you said makes sense. It should be at the end of the manage_switch method.

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

if (controller->is_async())
{
async_controller_threads_.at(controller_name)->activate();
}
}
// All controllers activated, switching done
switch_params_.do_switch = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what you said makes sense. It should be at the end of the manage_switch method.

Copy link
Contributor

@olivier-stasse olivier-stasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olivier-stasse
Copy link
Contributor

Actually the CI is failing.

Copy link
Contributor

@olivier-stasse olivier-stasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove the auto declaration in 1440.
The code does not compile in the CI for a good reason.

controller_manager/src/controller_manager.cpp Show resolved Hide resolved
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (3309c6d) 48.02% compared to head (9a1e13a) 47.83%.

❗ Current head 9a1e13a differs from pull request most recent head 771f4ab. Consider uploading reports for the commit 771f4ab to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1227      +/-   ##
==========================================
- Coverage   48.02%   47.83%   -0.19%     
==========================================
  Files          41       41              
  Lines        3525     3472      -53     
  Branches     1912     1887      -25     
==========================================
- Hits         1693     1661      -32     
- Misses        442      446       +4     
+ Partials     1390     1365      -25     
Flag Coverage Δ
unittests 47.83% <45.83%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
controller_manager/src/controller_manager.cpp 39.18% <45.83%> (+0.03%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@bmagyar bmagyar merged commit 6a98586 into master Jan 20, 2024
12 checks passed
@destogl destogl deleted the optimize-cm-code branch January 25, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants