|
|
Fl_Input_::drawtext ... has repeated checks for whether Fl::focus() == this, ...
Your suggestion to add Fl::focus() == this as a boolean parameter: Fl::focus() is a very fast inline method, it's just a memory lookup - there's not much potential for optimization if that's what you want to achieve. Thoughts:
- I don't think it's useful to add this extra argument - unless there's a compelling reason to pass a different information.
- In fact someone could pass the wrong information.
- Information hiding: the implementation doesn't require this argument, so don't force the caller to set it (there's no need to expose implementation details to the caller).
- If we ever wanted to "optimize" that code we could store
Fl::focus() == this in a local variable and subsequently use this variable.
- The compiler would (probably) do this for us anyway, at least if compiled with optimization.
That said, I propose to close this issue. Thanks for your second suggestion which has been committed.
If you have more comments or questions, please feel free to comment - or to close this issue.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
[ Direct Link to Message ] | |
|
| |