diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-02-13 10:30:59 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-02-13 10:30:59 +0100 |
commit | 8ff89e414770a922e45eee829b672aceb10ea609 (patch) | |
tree | accdab3630119096ce4f6361942a49152bd564b3 /src/MuxElements.cpp | |
parent | fb6ab762301d5da6b0eb3293d19cf545c4caf6ad (diff) | |
download | dabmux-8ff89e414770a922e45eee829b672aceb10ea609.tar.gz dabmux-8ff89e414770a922e45eee829b672aceb10ea609.tar.bz2 dabmux-8ff89e414770a922e45eee829b672aceb10ea609.zip |
Simplify and use isProgramme where possible
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r-- | src/MuxElements.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 809f09f..b7536b6 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -509,26 +509,17 @@ subchannel_type_t DabService::getType( bool DabService::isProgramme(const std::shared_ptr<dabEnsemble>& ensemble) const { - bool ret = false; switch (getType(ensemble)) { - case subchannel_type_t::DABAudio: // DAB - ret = true; - break; - case subchannel_type_t::DABPlusAudio: // DABPlus - ret = true; - break; + case subchannel_type_t::DABAudio: + case subchannel_type_t::DABPlusAudio: + return true; case subchannel_type_t::DataDmb: case subchannel_type_t::Packet: - ret = false; - break; + return false; default: - etiLog.log(error, - "Error, unknown service type: %u", - getType(ensemble)); - throw runtime_error("DabService::isProgramme unknown service type"); + etiLog.log(error, "Error, unknown service type: %u", getType(ensemble)); + throw logic_error("DabService::isProgramme unknown service type"); } - - return ret; } |