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

Commit 6a916ed0 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Add trimToSize() to public API." into jb-mr1-dev

parents 3a680382 d96b585f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22791,6 +22791,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;