From ea42d9dd4a9fc63781d49c696b208c0836e9fce3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 9 Mar 2015 22:37:42 +0000 Subject: [PATCH] Remove is_in_range utility function --- src/insert_completer.cc | 4 ++-- src/utils.hh | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 9d9bc7cd..45f9681f 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -295,8 +295,8 @@ void InsertCompleter::update() ByteCoord cursor = m_context.selections().main().cursor(); ByteCoord compl_beg = m_completions.begin; if (cursor.line == compl_beg.line and - is_in_range(cursor.column, compl_beg.column, - compl_beg.column + longest_completion-1)) + compl_beg.column <= cursor.column and + cursor.column < compl_beg.column + longest_completion) { String prefix = m_context.buffer().string(compl_beg, cursor); diff --git a/src/utils.hh b/src/utils.hh index c441cdf3..d8c6c994 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -132,12 +132,6 @@ const T& clamp(const T& val, const T& min, const T& max) return (val < min ? min : (val > max ? max : val)); } -template -bool is_in_range(const T& val, const T& min, const T& max) -{ - return min <= val and val <= max; -} - } #endif // utils_hh_INCLUDED