diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:36:23 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:46:02 -0500 |
commit | c583a2520616c2736cffc389c89a48b159366e6c (patch) | |
tree | b4925f26506fcee96c16119431c01760f05db95d /gdbsupport/gdb_binary_search.h | |
parent | ca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff) | |
download | gdb-users/simark/clang-format.zip gdb-users/simark/clang-format.tar.gz gdb-users/simark/clang-format.tar.bz2 |
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdbsupport/gdb_binary_search.h')
-rw-r--r-- | gdbsupport/gdb_binary_search.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdbsupport/gdb_binary_search.h b/gdbsupport/gdb_binary_search.h index b6771b9..4010a8c 100644 --- a/gdbsupport/gdb_binary_search.h +++ b/gdbsupport/gdb_binary_search.h @@ -17,13 +17,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ - #ifndef GDBSUPPORT_GDB_BINARY_SEARCH_H #define GDBSUPPORT_GDB_BINARY_SEARCH_H #include <algorithm> -namespace gdb { +namespace gdb +{ /* Implements a binary search using C++ iterators. This differs from std::binary_search in that it returns an iterator for @@ -39,17 +39,17 @@ namespace gdb { The return value is an iterator pointing to the found element, or LAST if no element was found. */ template<typename It, typename T, typename Comp> -It binary_search (It first, It last, T el, Comp comp) +It +binary_search (It first, It last, T el, Comp comp) { auto lt = [&] (const typename std::iterator_traits<It>::value_type &a, - const T &b) - { return comp (a, b) < 0; }; + const T &b) { return comp (a, b) < 0; }; auto lb = std::lower_bound (first, last, el, lt); if (lb != last) { if (comp (*lb, el) == 0) - return lb; + return lb; } return last; } |