-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] small performance improvement for MessageCatalogue::replace #11708
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
Conversation
👍 (even if it is clearly a micro-optimization) |
ping @nicolas-grekas |
👍 |
Wait: is there a possibility that someone has has specialized the |
It's not part of our BC promise. |
Even if it's not on our BC promise, this is clearly a behavior change and as such it cannot be committed in 2.3, but only master. |
I'm fine if it only goes into master. |
Thinking about it more, I think this should not be changed. If someone wants to alter the behavior of |
The internal implementation should never be relied on (if not explicitly defined for being extendable, like protected methods). So in this case if a user wants to change the behavior, he has to overwrite all public methods that are relevant, i.e. add and replace. |
I bet we have dozens of classes where replace()/set() does not call add(). |
Closing as it can break some code for no real benefit. |
Btw, the constructor doesn't call |
I suggest to close this one, the potential benefit looks micro, and we also have a potential bc break, let's stay on the safe side |
Cmon if we go this route then we would need to rewrite almost all classes in symfony to use the available getters instead of accessing private properties. We never do that. |
Saving an
isset
andarray_replace
call