Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b4e68d7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I4e5db32c,I2a448282

* changes:
  binder_ndk: fix performance-noexcept-move-constructor
  binder_ndk: fix bugprone-unhandled-self-assignment
parents 6c8e3812 c1bd43fe
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -74,6 +74,9 @@ class SpAIBinder {
     * ownership of that other object.
     */
    SpAIBinder& operator=(const SpAIBinder& other) {
        if (this == &other) {
            return *this;
        }
        AIBinder_incStrong(other.mBinder);
        set(other.mBinder);
        return *this;
@@ -170,8 +173,10 @@ class ScopedAResource {
    ScopedAResource& operator=(const ScopedAResource&) = delete;

    // move-constructing/assignment is okay
    ScopedAResource(ScopedAResource&& other) : mT(std::move(other.mT)) { other.mT = DEFAULT; }
    ScopedAResource& operator=(ScopedAResource&& other) {
    ScopedAResource(ScopedAResource&& other) noexcept : mT(std::move(other.mT)) {
        other.mT = DEFAULT;
    }
    ScopedAResource& operator=(ScopedAResource&& other) noexcept {
        set(other.mT);
        other.mT = DEFAULT;
        return *this;