BpfMap - fix a clang warning: misc-unconventional-assign-operator
//system/bpf/libbpf_android:libbpf_android_test clang-tidy BpfMapTest.cpp
system/bpf/libbpf_android/include/bpf/BpfMap.h:138:5: warning: operator=() should return 'BpfMap&' [misc-unconventional-assign-operator]
void operator=(BpfMap<Key, Value>&& other) noexcept {
^
Test: builds without warnings
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0bb0d42f58bba58c7b9220f062453d827438e85a
This commit is contained in:
parent
cdf85a3148
commit
8ed7c0f9b9
1 changed files with 3 additions and 2 deletions
|
|
@ -133,10 +133,11 @@ class BpfMap {
|
|||
return *this;
|
||||
}
|
||||
|
||||
// Move constructor
|
||||
void operator=(BpfMap<Key, Value>&& other) noexcept {
|
||||
// Move assignment operator
|
||||
BpfMap<Key, Value>& operator=(BpfMap<Key, Value>&& other) noexcept {
|
||||
mMapFd = std::move(other.mMapFd);
|
||||
other.reset(-1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void reset(base::unique_fd fd) = delete;
|
||||
|
|
|
|||
Loading…
Reference in a new issue