diff --git a/common/core/desktop/tests/unit/kmx/kmx.cpp b/common/core/desktop/tests/unit/kmx/kmx.cpp index bcb047f8d1..2f4ec39945 100644 --- a/common/core/desktop/tests/unit/kmx/kmx.cpp +++ b/common/core/desktop/tests/unit/kmx/kmx.cpp @@ -364,8 +364,6 @@ int run_test(const km::kbp::path & source, const km::kbp::path & compiled) { } std::string string_to_hex(const std::u16string& input) { - static const char hex_digits[] = "0123456789ABCDEF"; - std::ostringstream result; result << std::setfill('0') << std::hex << std::uppercase; diff --git a/linux/ibus-keyman/src/engine.c b/linux/ibus-keyman/src/engine.c index 080c3edbd9..e3f0dfd2b7 100644 --- a/linux/ibus-keyman/src/engine.c +++ b/linux/ibus-keyman/src/engine.c @@ -220,7 +220,7 @@ static void reset_context(IBusEngine *engine) g_message("new context is:%u:%s: cursor:%d anchor:%d", context_pos - context_start, surrounding_text, cursor_pos, anchor_pos); g_message(":%s:%s:", surrounding_text, current_context_utf8); - if (g_strcmp0(surrounding_text, current_context_utf8) != 0) + if (!g_str_has_suffix(surrounding_text, current_context_utf8)) { g_message("setting context because it has changed from expected"); if (km_kbp_context_items_from_utf8(surrounding_text, &context_items) == KM_KBP_STATUS_OK) {