From 7dbb538a3ea139c0f8eecb06e260628572994496 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 24 Jul 2018 16:29:52 +0200 Subject: Minor FIGCarousel cleanup --- src/fig/FIGCarousel.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp index bfd87c8..415f197 100644 --- a/src/fig/FIGCarousel.cpp +++ b/src/fig/FIGCarousel.cpp @@ -44,7 +44,8 @@ void FIGCarouselElement::reduce_deadline() deadline -= 24; //ms if (deadline < 0) { - etiLog.level(debug) << "Could not respect repetition rate for FIG " << + etiLog.level(debug) << + "Could not respect repetition rate for FIG " << fig->name() << " (" << deadline << "ms late)"; } } @@ -187,17 +188,18 @@ size_t FIGCarousel::carousel( FIBAllocation fibix; - if (fib == 0) { - fibix = FIBAllocation::FIB0; - } - else if (fib == 1) { - fibix = FIBAllocation::FIB1; - } - else if (fib == 2) { - fibix = FIBAllocation::FIB2; - } - else { - throw std::invalid_argument("FIGCarousel::carousel called with invalid fib"); + switch (fib) { + case 0: + fibix = FIBAllocation::FIB0; + break; + case 1: + fibix = FIBAllocation::FIB1; + break; + case 2: + fibix = FIBAllocation::FIB2; + break; + default: + throw std::invalid_argument("FIGCarousel::carousel called with invalid fib"); } // Create our list of FIGs to consider for this FIB -- cgit v1.2.3