Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #125121: Formula determining octave number affecting split staff …
…point
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
470095f
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.
This problem already occurred in commit 9649548
Maybe it’s time to factor this out into a macro?
#define TO_OCTAVE(x) (((x) / 12) - 1)
470095f
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.
Maybe it is time (in 2018) to avoid using macros for such calculations and start using unified namespace with such methods... Something like MSUtils?
Just my thoughts.
470095f
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.
@anatoly-os if you want to have function-call performance penalty on many (depending on the compiler and the implementation, even most) uses… sure… I’d prefer it to stay fast.
470095f
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.
@mirabilos I prefer facts. Scott Meyers showed some in Item '2: Prefer consts, enums, and inlines to #defines' in Effective C++. Personally, I have one more disadvantage - I cannot debug through macros. Speaking about performance, did you ever check the penalty you mentioned in MuseScore? I'm sure that such optimizations are not actual on desktop/laptop systems. So, as MuseScore is not used on embedded devices, I prefer maintainability and ease of support and debugging.