mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 08:18:08 +02:00
Use a 3 stage table for Unicode properties
Halves the data size and reduces source code size by 50x Shows no significant runtime performance effect. Allows for easily adding more properties to the table in the future
This commit is contained in:
34719
tools/wcswidth/char-props-data.go
generated
34719
tools/wcswidth/char-props-data.go
generated
File diff suppressed because one or more lines are too long
@@ -33,7 +33,7 @@ type GraphemeSegmentationState struct {
|
||||
}
|
||||
|
||||
func CharPropsFor(ch rune) CharProps {
|
||||
return charprops_t2[(rune(charprops_t1[ch>>charprops_shift])<<charprops_shift)+(ch&charprops_mask)]
|
||||
return charprops_t3[charprops_t2[(rune(charprops_t1[ch>>charprops_shift])<<charprops_shift)+(ch&charprops_mask)]]
|
||||
}
|
||||
|
||||
func IteratorOverGraphemes(text string) iter.Seq[string] {
|
||||
|
||||
Reference in New Issue
Block a user