Skip to content

Commit

Permalink
Change WordBreakProperty underlying type to int8_t (#715)
Browse files Browse the repository at this point in the history
This yields a ~1% performance improvements, likely
because the smaller types causes less load on memory
when bisearching the WordBreakProperty interval table

Co-authored-by: ArthurSonzogni <[email protected]>
  • Loading branch information
StefanRvO and ArthurSonzogni authored Aug 3, 2023
1 parent cebe49d commit b0a7f88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ current (development)
See the [OSC 8 page](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).
FTXUI support proposed by @aaleino in [#662](https://github.com/ArthurSonzogni/FTXUI/issues/662).

### Screen
- Breaking: `WordBreakProperty` becomes a uint8_t enum. This yields a 0.8%
performance improvement.


### Build
- Check version compatibility when using cmake find_package()
Expand Down
2 changes: 1 addition & 1 deletion src/ftxui/screen/string_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int GlyphCount(const std::string& input);

// Properties from:
// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/WordBreakProperty.txt
enum class WordBreakProperty {
enum class WordBreakProperty : int8_t {
ALetter,
CR,
Double_Quote,
Expand Down

0 comments on commit b0a7f88

Please sign in to comment.