diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-21 17:08:19 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-21 17:15:58 +0300 |
commit | dd8f6f3fe80fc8d59a9d8b2927cfb443912eee6c (patch) | |
tree | 2b6126c350b3268224a0580974277ba912a61989 | |
parent | 48dcfd22f9c2db5cf6745eaec0ff28895858c638 (diff) | |
download | sciteco-dd8f6f3fe80fc8d59a9d8b2927cfb443912eee6c.tar.gz |
discriminate against interactive-only codepaths in the imlementation of =/==/===
Small slow downs will not be noticable for interactively executed commands,
so we can well discriminate (G_UNLIKELY) against such code paths.
-rw-r--r-- | src/cmdline.h | 3 | ||||
-rw-r--r-- | src/core-commands.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cmdline.h b/src/cmdline.h index 1a57db5..be97c74 100644 --- a/src/cmdline.h +++ b/src/cmdline.h @@ -88,7 +88,8 @@ teco_cmdline_keymacro_c(gchar key, GError **error) static inline gboolean teco_cmdline_is_executing(teco_machine_main_t *ctx) { - return ctx == &teco_cmdline.machine && ctx->macro_pc == teco_cmdline.effective_len; + return G_UNLIKELY(ctx == &teco_cmdline.machine && + ctx->macro_pc == teco_cmdline.effective_len); } extern gboolean teco_quit_requested; diff --git a/src/core-commands.c b/src/core-commands.c index 2ccb8ec..2f6acb8 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -609,7 +609,8 @@ teco_print(guint radix, GError **error) * * If you want to print multiple values from the stack, * you have to put the \(lq=\(rq into a pass-through loop - * or separate the commands with whitespace. + * or separate the commands with + * whitespace (e.g. \(lq^Y= =\(rq). */ /* * In order to imitate TECO-11 closely, we apply the lookahead |