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

Make ObjectImpl<Logger>#GetSeverity() non-virtual #9851

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

Al2Klimov
Copy link
Member

After all it's not overridden.

@Al2Klimov Al2Klimov added the core/quality Improve code, libraries, algorithms, inline docs label Aug 15, 2023
@cla-bot cla-bot bot added the cla/signed label Aug 15, 2023
@yhabteab
Copy link
Member

How does marking only its setter method virtual make things even better? Marking only its setter as virtual makes no sense to me.

@Al2Klimov
Copy link
Member Author

Well, for a non-virtual method the address is known beforehand, but for a virtual one a lookup is required. And especially this method is called quite often.

@yhabteab
Copy link
Member

Well, for a non-virtual method the address is known beforehand, but for a virtual one a lookup is required.

Why don't you remove the virtual keyword completely then? As I said before, it makes no sense to mark a setter of an attribute as virtual, but not its getter as well. We only have one logger type anyway, so why do we want to mark any of its methods as virtual?

@Al2Klimov
Copy link
Member Author

Well, simply because we override it.

@Al2Klimov Al2Klimov added this to the 2.15.0 milestone Dec 21, 2023
@Al2Klimov Al2Klimov merged commit 28b2db8 into master Dec 22, 2023
23 checks passed
@Al2Klimov Al2Klimov deleted the Al2Klimov-patch-3 branch December 22, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed core/quality Improve code, libraries, algorithms, inline docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants