diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 03:14:05 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 06:07:34 +0100 |
commit | a94a7e8ba9080eb7a330fd64628e5cbe36be9fe6 (patch) | |
tree | 61fdd9668bb555e487e8e9257e5815854d461695 | |
parent | df9f83a249e59867373e06c79aa8f57a5c9640b7 (diff) | |
download | sciteco-a94a7e8ba9080eb7a330fd64628e5cbe36be9fe6.tar.gz |
some minor simplifications of the goto code
-rw-r--r-- | goto.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -102,24 +102,19 @@ StateLabel::custom(gchar chr) throw (Error) Goto::table->set(strings[0], macro_pc)); if (!g_strcmp0(strings[0], Goto::skip_label)) { - undo.push_str(Goto::skip_label); - g_free(Goto::skip_label); + g_free(undo.push_str(Goto::skip_label)); Goto::skip_label = NULL; - undo.push_var(mode); - mode = MODE_NORMAL; + undo.push_var(mode) = MODE_NORMAL; } - undo.push_str(strings[0]); - g_free(strings[0]); + g_free(undo.push_str(strings[0])); strings[0] = NULL; return &States::start; } - undo.push_str(strings[0]); - String::append(strings[0], chr); - + String::append(undo.push_str(strings[0]), chr); return this; } @@ -143,8 +138,7 @@ StateGotoCmd::done(const gchar *str) throw (Error) /* skip till label is defined */ undo.push_str(Goto::skip_label); Goto::skip_label = g_strdup(labels[value-1]); - undo.push_var(mode); - mode = MODE_PARSE_ONLY_GOTO; + undo.push_var(mode) = MODE_PARSE_ONLY_GOTO; } } |