From e77fb313b3819b6298f16277bf29042c31cce8bc Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 11 Jul 2016 00:02:11 +0200 Subject: [PATCH] improve differ performance --- src/fenrir-package/screen/linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fenrir-package/screen/linux.py b/src/fenrir-package/screen/linux.py index 3c8ea9fd..9a09e839 100644 --- a/src/fenrir-package/screen/linux.py +++ b/src/fenrir-package/screen/linux.py @@ -52,7 +52,7 @@ class screenManager(): # changes on the screen if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \ (len(environment['screenData']['newContentText']) > 0): - diff = difflib.ndiff(environment['screenData']['oldContentText'], environment['screenData']['newContentText']) + diff = difflib.ndiff(" ".join(environment['screenData']['oldContentText'].split()), " ".join(environment['screenData']['newContentText'].split())) environment['screenData']['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ ')) if ((len(environment['screenData']['delta']) < 3)): environment['runtime']['speechDriver'].cancel()