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

Commit d77bce88 authored by Jake Wharton's avatar Jake Wharton
Browse files

Expose removeAt(int) for parity with other sparse collections.

Bug: 70934959
Test: none
Change-Id: Ic26a9fba610d6361247e0485803b52569fbf4a38
parent 82b43303
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44099,6 +44099,7 @@ package android.util {
    method public int indexOfValue(boolean);
    method public int keyAt(int);
    method public void put(int, boolean);
    method public void removeAt(int);
    method public int size();
    method public boolean valueAt(int);
  }
+5 −1
Original line number Diff line number Diff line
@@ -117,7 +117,11 @@ public class SparseBooleanArray implements Cloneable {
        }
    }

    /** @hide */
    /**
     * Removes the mapping at the specified index.
     * <p>
     * For indices outside of the range {@code 0...size()-1}, the behavior is undefined.
     */
    public void removeAt(int index) {
        System.arraycopy(mKeys, index + 1, mKeys, index, mSize - (index + 1));
        System.arraycopy(mValues, index + 1, mValues, index, mSize - (index + 1));