Make better use of range_t methods.

This commit is contained in:
Jared Boone 2016-01-27 14:46:45 -08:00
parent ca3b1a2c5a
commit 7519b83379
8 changed files with 39 additions and 72 deletions

View file

@ -83,13 +83,11 @@ Config high_band(const rf::Frequency target_frequency) {
Config create(const rf::Frequency target_frequency) {
/* TODO: This is some lame code. */
if( target_frequency < rf::path::band_low.min ) {
return { };
} else if( target_frequency < rf::path::band_low.max ) {
if( rf::path::band_low.contains(target_frequency) ) {
return low_band(target_frequency);
} else if( target_frequency < rf::path::band_mid.max ) {
} else if( rf::path::band_mid.contains(target_frequency) ) {
return mid_band(target_frequency);
} else if( target_frequency < rf::path::band_high.max ) {
} else if( rf::path::band_high.contains(target_frequency) ) {
return high_band(target_frequency);
} else {
return { };