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

Commit 2c82a4b5 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Fixes SparseSetArray#add return logic

Docs state that adding a key value pair that already exists will return
false, else true. The actual behavior is reverse. This change fixes
that.

Test: atest AppStateTrackerTest
Change-Id: I2593f2ba22b5972cccb1c0b3dc5aabb4ed65a023
parent 6a2158f4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@ public class SparseSetArray<T> {
            mData.put(n, set);
        }
        if (set.contains(value)) {
            return true;
            return false;
        }
        set.add(value);
        return false;
        return true;
    }

    /**