<commit_before>package com.charlesmadere.hummingbird.misc;

import android.support.annotation.Nullable;
import android.support.v4.util.LruCache;
import android.text.TextUtils;

import com.charlesmadere.hummingbird.models.Feed;

public final class FeedCache {

    private static final String TAG = "FeedCache";
    private static final LruCache<String, Feed> CACHE;


    static {
        if (MiscUtils.isLowRamDevice()) {
            CACHE = new LruCache<>(8);
        } else {
            CACHE = new LruCache<>(12);
        }
    }

    private static String buildKey(final String... keys) {
        return TextUtils.join("|", keys);
    }

    public static synchronized void clear() {
        CACHE.evictAll();
    }

    @Nullable
    public static Feed get(final KeyProvider keyProvider) {
        if (keyProvider == null) {
            throw new IllegalArgumentException("keyProvider parameter can't be null");
        }

        return get(keyProvider.getFeedCacheKeys());<commit_msg>shrank the FeedCache even more<commit_after>package com.charlesmadere.hummingbird.misc;

import android.support.annotation.Nullable;
import android.support.v4.util.LruCache;
import android.text.TextUtils;

import com.charlesmadere.hummingbird.models.Feed;

public final class FeedCache {

    private static final String TAG = "FeedCache";
    private static final LruCache<String, Feed> CACHE;


    static {
        if (MiscUtils.isLowRamDevice()) {
            CACHE = new LruCache<>(6);
        } else {
            CACHE = new LruCache<>(10);
        }
    }

    private static String buildKey(final String... keys) {
        return TextUtils.join("|", keys);
    }

    public static synchronized void clear() {
        CACHE.evictAll();
    }

    @Nullable
    public static Feed get(final KeyProvider keyProvider) {
        if (keyProvider == null) {
            throw new IllegalArgumentException("keyProvider parameter can't be null");
        }

        return get(keyProvider.getFeedCacheKeys());
{'fraction_non_alphanumeric': 0.10084872690963555, 'fraction_numerical': 0.00399400898652022, 'mean_word_length': 2.817142857142857, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4629506', 'n_tokens_mistral': 584, 'n_tokens_neox': 550, 'n_words': 143}