mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 14:04:52 +02:00
Coalesce neighboring symbol maps for better lookup performance
This commit is contained in:
@@ -11,7 +11,9 @@ from kitty.fast_data_types import (
|
||||
test_render_line, test_sprite_position_for, wcwidth
|
||||
)
|
||||
from kitty.fonts.box_drawing import box_chars
|
||||
from kitty.fonts.render import render_string, setup_for_testing, shape_string
|
||||
from kitty.fonts.render import (
|
||||
coalesce_symbol_maps, render_string, setup_for_testing, shape_string
|
||||
)
|
||||
|
||||
from . import BaseTest
|
||||
|
||||
@@ -122,3 +124,7 @@ class Rendering(BaseTest):
|
||||
finally:
|
||||
sys.stderr = orig
|
||||
self.assertIn('LastResort', buf.getvalue())
|
||||
|
||||
def test_coalesce_symbol_maps(self):
|
||||
q = {(2, 3): 'a', (4, 6): 'b', (5, 5): 'b', (7, 7): 'b', (9, 9): 'b', (1, 1): 'a'}
|
||||
self.ae(coalesce_symbol_maps(q), {(1, 3): 'a', (4, 7): 'b', (9, 9): 'b'})
|
||||
|
||||
Reference in New Issue
Block a user