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

Commit d96b585f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Add trimToSize() to public API.

Bug: 6602490
Bug: http://code.google.com/p/android/issues/detail?id=35349
Change-Id: Ib3bc7fee05bb0edc375ebee1c40a1d7bd82e2a17
parent 24d19fb6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22776,6 +22776,7 @@ package android.util {
    method protected int sizeOf(K, V);
    method public final synchronized java.util.Map<K, V> snapshot();
    method public final synchronized java.lang.String toString();
    method public void trimToSize(int);
  }
  public final class MalformedJsonException extends java.io.IOException {
+5 −2
Original line number Diff line number Diff line
@@ -186,10 +186,13 @@ public class LruCache<K, V> {
    }

    /**
     * Remove the eldest entries until the total of remaining entries is at or
     * below the requested size.
     *
     * @param maxSize the maximum size of the cache before returning. May be -1
     *            to evict even 0-sized elements.
     */
    private void trimToSize(int maxSize) {
    public void trimToSize(int maxSize) {
        while (true) {
            K key;
            V value;