Micro-optimization

This commit is contained in:
Kovid Goyal 2017-10-28 13:45:52 +05:30
parent 76d6d5f94b
commit ed6049b4be
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -129,6 +129,8 @@ def face_for_text(text, bold=False, italic=False):
def render_text(text, bold=False, italic=False, num_cells=1):
if text == ' ' and num_cells == 1:
return (CharTexture(),)
font, face = face_for_text(text, bold, italic)
func = partial(face.draw_single_glyph, ord(text[0])) if len(text) == 1 else partial(face.draw_complex_glyph, text)
if num_cells == 1: