From e0428fa102ac33af3d65ba2b76c2bc883c18df73 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 18 Jul 2016 19:46:55 +0200 Subject: [PATCH] speedup checks --- .../onInput/54000-read_char_if_cursor_change_horizontal.py | 2 +- .../onInput/55000-read_line_if_cursor_change_vertical.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py index bd2e616b..890a138f 100644 --- a/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py +++ b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py @@ -7,7 +7,7 @@ class command(): if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\ environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']: return environment - if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].replace(" ","").replace("\n","").replace("\t","") == '': + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].strip(" \n\t") == '': pass #environment['runtime']['outputManager'].presentText(environment, "blank",True) else: diff --git a/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py index 4e2c212f..ccfa5aa0 100644 --- a/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py +++ b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py @@ -8,7 +8,7 @@ class command(): # return environment if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']: return environment - if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].replace(" ","").replace("\n","").replace("\t","") == '': + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].strip(" \t\n") == '': environment['runtime']['outputManager'].presentText(environment, "blank", True) else: environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)