aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/core/interest.cc
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-09-02 14:34:36 +0000
committerMauro Sardara <msardara@cisco.com>2022-09-02 14:42:53 +0000
commitcb6f5724b85e51295498a39144ed4ccce114ad53 (patch)
tree090b6753d305fd7bc25b84879b63581bbec3b38c /libtransport/src/core/interest.cc
parent00a6f92b97a0456259163ade2085defdebeb3f84 (diff)
fix(sonar): make sonarqube happy
Ref: HICN-766 HICN-767 HICN-764 HICN-762 HICN-743 HICN-759 HICN-760 HICN-758 HICN-761 HICN-756 Change-Id: Ic2accf6b6771c7a78d2b22d9bdb8e5a5be9ead8a Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/core/interest.cc')
-rw-r--r--libtransport/src/core/interest.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/libtransport/src/core/interest.cc b/libtransport/src/core/interest.cc
index 10e1a6dfa..6348a8d3e 100644
--- a/libtransport/src/core/interest.cc
+++ b/libtransport/src/core/interest.cc
@@ -76,14 +76,13 @@ Interest &Interest::operator=(const Interest &other) {
return (Interest &)Packet::operator=(other);
}
-Interest::~Interest() {}
+Interest::~Interest() = default;
const Name &Interest::getName() const {
- if (!name_) {
- if (hicn_interest_get_name(
- &pkbuf_, (hicn_name_t *)&name_.getConstStructReference()) < 0) {
- throw errors::MalformedPacketException();
- }
+ if (!name_ &&
+ hicn_interest_get_name(
+ &pkbuf_, (hicn_name_t *)&name_.getConstStructReference()) < 0) {
+ throw errors::MalformedPacketException();
}
return name_;
@@ -149,7 +148,7 @@ void Interest::resetForHash() {
}
}
-bool Interest::hasManifest() {
+bool Interest::hasManifest() const {
return (getPayloadType() == PayloadType::MANIFEST);
}
@@ -174,8 +173,7 @@ void Interest::encodeSuffixes() {
memset(int_manifest_header->request_bitmap, 0xFFFFFFFF,
BITMAP_SIZE * sizeof(hicn_uword));
- uint32_t *suffix = (uint32_t *)(int_manifest_header + 1);
- for (auto it = suffix_set_.begin(); it != suffix_set_.end(); it++, suffix++) {
+ for (auto it = suffix_set_.begin(); it != suffix_set_.end(); it++) {
interest_manifest_add_suffix(int_manifest_header, *it);
}