projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c25d91
)
View: Simplified get_traces
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 1 Sep 2014 20:56:56 +0000
(21:56 +0100)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Wed, 19 Nov 2014 10:23:01 +0000
(10:23 +0000)
pv/view/view.cpp
patch
|
blob
|
history
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index 305031ebd466c9a0b699e4641fa8b6639b8c5e5c..388c4c49ec75e00f35fac366366bef960823a87c 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-43,6
+43,7
@@
#include "pv/data/logicsnapshot.h"
using pv::data::SignalData;
#include "pv/data/logicsnapshot.h"
using pv::data::SignalData;
+using std::back_inserter;
using std::deque;
using std::list;
using std::max;
using std::deque;
using std::list;
using std::max;
@@
-242,21
+243,16
@@
void View::set_scale_offset(double scale, double offset)
vector< shared_ptr<Trace> > View::get_traces() const
{
vector< shared_ptr<Trace> > View::get_traces() const
{
+ vector< shared_ptr<Trace> > traces;
+
const vector< shared_ptr<Signal> > sigs(
session().get_signals());
const vector< shared_ptr<Signal> > sigs(
session().get_signals());
+ copy(sigs.begin(), sigs.end(), back_inserter(traces));
+
#ifdef ENABLE_DECODE
const vector< shared_ptr<DecodeTrace> > decode_sigs(
session().get_decode_signals());
#ifdef ENABLE_DECODE
const vector< shared_ptr<DecodeTrace> > decode_sigs(
session().get_decode_signals());
- vector< shared_ptr<Trace> > traces(
- sigs.size() + decode_sigs.size());
-#else
- vector< shared_ptr<Trace> > traces(sigs.size());
-#endif
-
- auto i = traces.begin();
- i = copy(sigs.begin(), sigs.end(), i);
-#ifdef ENABLE_DECODE
- i = copy(decode_sigs.begin(), decode_sigs.end(), i);
+ copy(decode_sigs.begin(), decode_sigs.end(), back_inserter(traces));
#endif
stable_sort(traces.begin(), traces.end(),
#endif
stable_sort(traces.begin(), traces.end(),