Simplify conditions.
authorCarl Hetherington <cth@carlh.net>
Fri, 21 Mar 2025 12:34:33 +0000 (13:34 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 22 Mar 2025 12:29:59 +0000 (13:29 +0100)
Only Type::FULL can have non-null encoded, so I don't think there's any
point in checking for both things.

src/lib/writer.cc

index 563a86e80eb368ebd2e98c1cbe9ad505a5e93127..3061f36d48a180436d18cd7259f403403c55612a 100644 (file)
@@ -423,7 +423,7 @@ try
                        auto qi = _queue.front ();
                        _last_written[qi.reel].update (qi);
                        _queue.pop_front ();
-                       if (qi.type == QueueItem::Type::FULL && qi.encoded) {
+                       if (qi.encoded) {
                                --_queued_full_in_memory;
                        }
 
@@ -464,7 +464,7 @@ try
                        /* Find one from the back of the queue */
                        _queue.sort ();
                        auto item = _queue.rbegin();
-                       while (item != _queue.rend() && (item->type != QueueItem::Type::FULL || !item->encoded)) {
+                       while (item != _queue.rend() && !item->encoded) {
                                ++item;
                        }