#
19390213 |
| 02-Jun-2017 |
Dale Cieslak <dcieslak@yahoo.com> |
CharacterMap: Use binary searches rather than linear lookups where possible.
UnicodeBlockView::SelectBlockForCharacter and CharacterView::_FrameFor use the same linear search to find which block a c
CharacterMap: Use binary searches rather than linear lookups where possible.
UnicodeBlockView::SelectBlockForCharacter and CharacterView::_FrameFor use the same linear search to find which block a character is in, so I refactored both to use a shared BlockForCharacter function in UnicodeBlocks.cpp that is a binary search. CharacterView::_BlockAt also had a TODO comment to use a binary search, so I rewrote it as a binary search. It's not the same search as the aforementioned BlockForCharacter function. These two changes ought to improve the overall performance of CharacterMap.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
show more ...
|