From d63629b370c4e38db527605863f0533666b6f629 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 7 Jul 2019 16:32:18 +0200 Subject: performance improvements * action() returns void - this gets rid of checks in vt_from_slave() * split up ACTION_PRINT into ACTION_PRINT (ASCII) and ACTION_UTF8_PRINT ACTION_PRINT is on the hot path, and we want it streamlined. * Remove run-time checkout for unimplemented state transitions, as we shouldn't have any of those left. * Don't re-load current VT state on each iteration in vt_from_slave() --- osc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'osc.c') diff --git a/osc.c b/osc.c index 6c523116..efaab15f 100644 --- a/osc.c +++ b/osc.c @@ -7,7 +7,7 @@ #include "log.h" #include "render.h" -bool +void osc_dispatch(struct terminal *term) { int param = 0; @@ -24,7 +24,7 @@ osc_dispatch(struct terminal *term) if (!isdigit(c)) { LOG_ERR("OSC: invalid parameter: %.*s", (int)term->vt.osc.idx, term->vt.osc.data); - return false; + abort(); } param *= 10; @@ -47,8 +47,7 @@ osc_dispatch(struct terminal *term) default: LOG_ERR("unimplemented: OSC: %.*s", (int)term->vt.osc.idx, term->vt.osc.data); - return false; + abort(); + break; } - - return true; } -- cgit v1.3