21 lines
593 B
Diff
21 lines
593 B
Diff
|
Source: https://bugzilla.mozilla.org/show_bug.cgi?id=1758478
|
||
|
diff --git a/nss/cpputil/databuffer.h b/nss/cpputil/databuffer.h
|
||
|
index 8d34e1a..6aee509 100644
|
||
|
--- a/nss/cpputil/databuffer.h
|
||
|
+++ b/nss/cpputil/databuffer.h
|
||
|
@@ -33,11 +33,9 @@ class DataBuffer {
|
||
|
return *this;
|
||
|
}
|
||
|
DataBuffer& operator=(DataBuffer&& other) {
|
||
|
- if (this == &other) {
|
||
|
- data_ = other.data_;
|
||
|
- len_ = other.len_;
|
||
|
- other.data_ = nullptr;
|
||
|
- other.len_ = 0;
|
||
|
+ if (this != &other) {
|
||
|
+ std::swap(data_, other.data_);
|
||
|
+ std::swap(len_, other.len_);
|
||
|
}
|
||
|
return *this;
|
||
|
}
|