From 87e71bcde786d2b2f8a04b699f2f64e276d983dc Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 6 Feb 2019 23:45:14 +0100 Subject: [PATCH] input: Remove useless .c_str (Also removes some dead code) --- src/input.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index f62c11f32..0a9e9a008 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -176,7 +176,7 @@ void input_set_bind_mode(const wcstring &bm) { ASSERT_IS_MAIN_THREAD(); auto &vars = parser_t::principal_parser().vars(); assert(!bm.empty()); - if (input_get_bind_mode(vars) != bm.c_str()) { + if (input_get_bind_mode(vars) != bm) { vars.set_one(FISH_BIND_MODE_VAR, ENV_GLOBAL, bm); } } @@ -224,10 +224,6 @@ void input_mapping_add(const wchar_t *sequence, const wchar_t *const *commands, CHECK(mode, ); CHECK(sets_mode, ); - // debug( 0, L"Add mapping from %ls to %ls in mode %ls", escape_string(sequence, - // ESCAPE_ALL).c_str(), - // escape_string(command, ESCAPE_ALL).c_str(), mode); - // Remove existing mappings with this sequence. const wcstring_list_t commands_vector(commands, commands + commands_len); @@ -372,7 +368,7 @@ static void input_mapping_execute(const input_mapping_t &m, bool allow_commands) // see that until all other commands have also been run. int last_status = proc_get_last_status(); for (const wcstring &cmd : m.commands) { - parser_t::principal_parser().eval(cmd.c_str(), io_chain_t(), TOP); + parser_t::principal_parser().eval(cmd, io_chain_t(), TOP); } proc_set_last_status(last_status); input_common_next_ch(R_NULL);