From 2c25d912f97ca7bedd9c03f4827fe8d8a189e8bc Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 29 Aug 2014 12:58:59 +0100 Subject: [PATCH] View: Replace compare_trace_v_offsets with a lambda --- pv/view/view.cpp | 13 ++++--------- pv/view/view.h | 4 ---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pv/view/view.cpp b/pv/view/view.cpp index af0892b8..305031eb 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -259,7 +259,10 @@ vector< shared_ptr > View::get_traces() const i = copy(decode_sigs.begin(), decode_sigs.end(), i); #endif - stable_sort(traces.begin(), traces.end(), compare_trace_v_offsets); + stable_sort(traces.begin(), traces.end(), + [](const shared_ptr &a, const shared_ptr &b) { + return a->get_v_offset() < b->get_v_offset(); }); + return traces; } @@ -442,14 +445,6 @@ void View::update_layout() update_scroll(); } -bool View::compare_trace_v_offsets(const shared_ptr &a, - const shared_ptr &b) -{ - assert(a); - assert(b); - return a->get_v_offset() < b->get_v_offset(); -} - bool View::eventFilter(QObject *object, QEvent *event) { const QEvent::Type type = event->type(); diff --git a/pv/view/view.h b/pv/view/view.h index 8229fbd2..6e097a4d 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -164,10 +164,6 @@ private: void update_layout(); - static bool compare_trace_v_offsets( - const std::shared_ptr &a, - const std::shared_ptr &b); - private: bool eventFilter(QObject *object, QEvent *event); -- 2.30.2