From a437e9488bdf2059e3f1890fc8bf255b3326b163 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 27 Mar 2013 14:09:09 +0100 Subject: [PATCH] idvaluemap, FunctionGroup: consitfy completion methods --- src/function_group.hh | 6 +++--- src/idvaluemap.hh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/function_group.hh b/src/function_group.hh index bafdab27..2772389c 100644 --- a/src/function_group.hh +++ b/src/function_group.hh @@ -44,15 +44,15 @@ public: return *group; } - CandidateList complete_id(const String& prefix, ByteCount cursor_pos) + CandidateList complete_id(const String& prefix, ByteCount cursor_pos) const { return m_functions.complete_id(prefix, cursor_pos); } - CandidateList complete_group_id(const String& prefix, ByteCount cursor_pos) + CandidateList complete_group_id(const String& prefix, ByteCount cursor_pos) const { return m_functions.complete_id_if( - prefix, cursor_pos, [](FunctionAndId& func) { + prefix, cursor_pos, [](const FunctionAndId& func) { return func.second.template target() != nullptr; }); } diff --git a/src/idvaluemap.hh b/src/idvaluemap.hh index e11c327a..b2cebb1d 100644 --- a/src/idvaluemap.hh +++ b/src/idvaluemap.hh @@ -66,7 +66,7 @@ public: template CandidateList complete_id_if(const String& prefix, ByteCount cursor_pos, - _Condition condition) + _Condition condition) const { String real_prefix = prefix.substr(0, cursor_pos); CandidateList result; @@ -83,7 +83,7 @@ public: } CandidateList complete_id(const String& prefix, - ByteCount cursor_pos) + ByteCount cursor_pos) const { return complete_id_if( prefix, cursor_pos, [](const value_type&) { return true; });