API to set text in Line efficiently

This commit is contained in:
Kovid Goyal
2016-10-17 13:50:53 +05:30
parent b02dc836fb
commit 44e8238eaf
3 changed files with 35 additions and 18 deletions

View File

@@ -8,12 +8,3 @@ from unittest import TestCase
class BaseTest(TestCase):
ae = TestCase.assertEqual
def set_text_in_line(line, text, offset=0):
pos = offset
for ch in text:
line.set_char(pos, ch)
pos += 1
if pos >= len(line):
break