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
Use std::string_view for MessageLogger category #31498
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31498/18447
|
A new Pull Request was created by @makortel (Matti Kortelainen) for master. It involves the following packages: FWCore/MessageLogger @makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild, please test |
The tests are being triggered in jenkins.
|
@@ -45,7 +45,7 @@ namespace edm { | |||
public: | |||
// --- birth/death: | |||
// | |||
ErrorObj(const ELseverityLevel& sev, const ELstring& id, bool verbatim = false); | |||
ErrorObj(const ELseverityLevel& sev, std::string_view id, bool verbatim = false); |
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.
@Dr15Jones Given that ELseverityLevel
is essentially an int
, I wonder if we should pass it around by value instead of by reference?
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.
Passing by value makes sense to me. (Much of the internals of MessageLogger are C++98 era of code)
Could you also go the extra mile and get rid of all references to |
Happy to. |
thanks @makortel! |
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Resolves #31475. Should avoid one
std::string
construction when the category is passed in aschar const*
.PR validation:
Framework unit tests pass.