Merge "Add trimToSize() to public API." into jb-mr1-dev
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
* to evict even 0-sized elements.
|
||||
*/
|
||||
private void trimToSize(int maxSize) {
|
||||
public void trimToSize(int maxSize) {
|
||||
while (true) {
|
||||
K key;
|
||||
V value;
|
||||
|
||||
Reference in New Issue
Block a user