aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Tsou <tom.tsou@ettus.com>2016-10-04 11:57:53 -0700
committerTom Tsou <tom.tsou@ettus.com>2016-10-04 11:59:05 -0700
commite5c36f6abb39ab0e1379f88efe9bd1977cff4261 (patch)
treeee17066d32b1e59708fe41d984f26006ac978c76
parentbbefe9eaff78284e3f1c8861c4372c36c25f4b34 (diff)
sigproc: Remove non-functional length check
Remove unsigned comparision against less than zero. Fixes: Coverity CID 149351 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
-rw-r--r--Transceiver52M/sigProcLib.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index be89bb9..aa40153 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1729,8 +1729,10 @@ bool energyDetect(signalVector &rxBurst,
signalVector::const_iterator windowItr = rxBurst.begin(); //+rxBurst.size()/2 - 5*windowLength/2;
float energy = 0.0;
- if (windowLength < 0) windowLength = 20;
- if (windowLength > rxBurst.size()) windowLength = rxBurst.size();
+
+ if (windowLength > rxBurst.size())
+ windowLength = rxBurst.size();
+
for (unsigned i = 0; i < windowLength; i++) {
energy += windowItr->norm2();
windowItr+=4;