]> sigrok.org Git - pulseview.git/blobdiff - pv/data/logic.cpp
Fix random clazy warnings
[pulseview.git] / pv / data / logic.cpp
index e78c28468d71ef42da07e7e0eb102076889cfd38..516060a0aec9013c139f8597dc0bf9bfd70de6aa 100644 (file)
@@ -69,10 +69,18 @@ void Logic::clear()
        samples_cleared();
 }
 
+double Logic::get_samplerate() const
+{
+       if (segments_.empty())
+               return 1.0;
+
+       return segments_.front()->samplerate();
+}
+
 uint64_t Logic::max_sample_count() const
 {
        uint64_t l = 0;
-       for (shared_ptr<LogicSegment> s : segments_) {
+       for (const shared_ptr<LogicSegment>& s : segments_) {
                assert(s);
                l = max(l, s->get_sample_count());
        }