From 1d185fb152bd31233b699dd817fa5ab142cea15a Mon Sep 17 00:00:00 2001 From: Francisco Date: Sat, 20 Feb 2021 21:17:08 +0000 Subject: [PATCH] use macro for rlc tx window size. refactor tx window clearing --- lib/include/srslte/upper/rlc_am_lte.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/include/srslte/upper/rlc_am_lte.h b/lib/include/srslte/upper/rlc_am_lte.h index d514a1f79..be0d1f164 100644 --- a/lib/include/srslte/upper/rlc_am_lte.h +++ b/lib/include/srslte/upper/rlc_am_lte.h @@ -72,7 +72,7 @@ struct pdcp_sdu_info_t { struct tx_window_t { tx_window_t() { - std::fill(active_flag.begin(), active_flag.end(), false); + clear(); for (size_t i = 0; i < window.size(); ++i) { window[i].pdcp_sns.reserve(5); } @@ -100,8 +100,10 @@ struct tx_window_t { bool empty() const { return count == 0; } void clear() { - window = {}; std::fill(active_flag.begin(), active_flag.end(), false); + for (size_t i = 0; i < window.size(); ++i) { + window[i].pdcp_sns.clear(); + } count = 0; } bool has_sn(uint32_t sn) const { return active_flag[sn] and window[sn].rlc_sn == sn; } @@ -120,9 +122,9 @@ struct tx_window_t { } private: - size_t count = 0; - srslte::circular_array active_flag = {}; - srslte::circular_array window; + size_t count = 0; + srslte::circular_array active_flag = {}; + srslte::circular_array window; }; class rlc_am_lte : public rlc_common