summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerii Zapodovnikov <val.zapod.vz@gmail.com>2020-01-18 12:49:58 +0300
committerMichael Dickens <michael.dickens@ettus.com>2020-01-24 14:26:33 -0500
commit09c2cf363dd7b32456e27aee92f3ec7649c9d763 (patch)
tree5c9c783d4067039a9b3901cd17d9b18b177823eb
parent26886d80d0ade51709c4c0389fd54b813ade9ec6 (diff)
gr-digital: cleanup double assignments
and change one variable to bool
-rw-r--r--gr-digital/lib/correlate_access_code_bb_impl.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/gr-digital/lib/correlate_access_code_bb_impl.cc b/gr-digital/lib/correlate_access_code_bb_impl.cc
index 15f37ee0c1..69593e9ab7 100644
--- a/gr-digital/lib/correlate_access_code_bb_impl.cc
+++ b/gr-digital/lib/correlate_access_code_bb_impl.cc
@@ -97,15 +97,11 @@ int correlate_access_code_bb_impl::work(int noutput_items,
out[i] = t;
// compute hamming distance between desired access code and current data
- unsigned long long wrong_bits = 0;
- unsigned int nwrong = d_threshold + 1;
- int new_flag = 0;
-
- wrong_bits = (d_data_reg ^ d_access_code) & d_mask;
- nwrong = gr::blocks::count_bits64(wrong_bits);
+ unsigned long long wrong_bits = (d_data_reg ^ d_access_code) & d_mask;
+ unsigned int nwrong = gr::blocks::count_bits64(wrong_bits);
// test for access code with up to threshold errors
- new_flag = (nwrong <= d_threshold);
+ bool new_flag = (nwrong <= d_threshold);
// shift in new data and new flag
d_data_reg = (d_data_reg << 1) | (in[i] & 0x1);