Chromium Code Reviews| Index: base/win/scoped_handle.h |
| diff --git a/base/win/scoped_handle.h b/base/win/scoped_handle.h |
| index 62734b631c54e43a1d5a9938c065ca42fd7bd8e4..e08aa8655bffba6b321a780d8110711b9a588623 100644 |
| --- a/base/win/scoped_handle.h |
| +++ b/base/win/scoped_handle.h |
| @@ -49,8 +49,10 @@ class GenericScopedHandle { |
| } |
| // Move constructor for C++03 move emulation of this type. |
| - GenericScopedHandle(RValue& other) : handle_(Traits::NullHandle()) { |
| - Set(other.Take()); |
| + GenericScopedHandle(RValue other) : handle_(Traits::NullHandle()) { |
| + if (this != other.object) { |
|
Jeffrey Yasskin
2012/10/12 20:34:47
I think this can never be false.
awong
2012/10/12 20:44:12
Oops. This was a error during a revert. Fixed.
|
| + Set(other.object->Take()); |
| + } |
| } |
| ~GenericScopedHandle() { |
| @@ -62,10 +64,8 @@ class GenericScopedHandle { |
| } |
| // Move operator= for C++03 move emulation of this type. |
| - GenericScopedHandle& operator=(RValue& other) { |
| - if (this != &other) { |
| - Set(other.Take()); |
| - } |
| + GenericScopedHandle& operator=(RValue other) { |
| + Set(other.object->Take()); |
| return *this; |
| } |