summaryrefslogtreecommitdiff
path: root/common/native/bpf_headers/include/bpf/BpfMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/native/bpf_headers/include/bpf/BpfMap.h')
-rw-r--r--common/native/bpf_headers/include/bpf/BpfMap.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/common/native/bpf_headers/include/bpf/BpfMap.h b/common/native/bpf_headers/include/bpf/BpfMap.h
index 51e6d162..1ddcfe66 100644
--- a/common/native/bpf_headers/include/bpf/BpfMap.h
+++ b/common/native/bpf_headers/include/bpf/BpfMap.h
@@ -235,12 +235,9 @@ class BpfMap {
base::Result<bool> isEmpty() const {
auto key = getFirstKey();
- if (!key.ok()) {
- // Return error code ENOENT means the map is empty
- if (key.error().code() == ENOENT) return true;
- return key.error();
- }
- return false;
+ if (key.ok()) return false;
+ if (key.error().code() == ENOENT) return true;
+ return key.error();
}
private: