<commit_before>package nodomain.freeyourgadget.gadgetbridge.util;

import android.util.Pair;

import java.util.Iterator;
import java.util.LinkedList;

public class LimitedQueue {
    private final int limit;
    private LinkedList<Pair> list = new LinkedList<>();

    public LimitedQueue(int limit) {
        this.limit = limit;
    }

    public void add(int id, Object obj) {
        if (list.size() > limit - 1) {
            list.removeFirst();
        }
        list.add(new Pair<>(id, obj));
    }

    public void remove(int id) {
        for (Iterator<Pair> iter = list.iterator(); iter.hasNext(); ) {
            Pair pair = iter.next();
            if (pair.first == id) {
                iter.remove();
            }
        }
    }

    public Object lookup(int id) {<commit_msg>Android studio 2 complains about this comparison otherwise<commit_after>package nodomain.freeyourgadget.gadgetbridge.util;

import android.util.Pair;

import java.util.Iterator;
import java.util.LinkedList;

public class LimitedQueue {
    private final int limit;
    private LinkedList<Pair> list = new LinkedList<>();

    public LimitedQueue(int limit) {
        this.limit = limit;
    }

    public void add(int id, Object obj) {
        if (list.size() > limit - 1) {
            list.removeFirst();
        }
        list.add(new Pair<>(id, obj));
    }

    public void remove(int id) {
        for (Iterator<Pair> iter = list.iterator(); iter.hasNext(); ) {
            Pair pair = iter.next();
            if (((int)pair.first) == id) {
                iter.remove();
            }
        }
    }

    public Object lookup(int id) {
{'fraction_non_alphanumeric': 0.12224938875305623, 'fraction_numerical': 0.0018337408312958435, 'mean_word_length': 2.1724806201550386, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '3112409', 'n_tokens_mistral': 487, 'n_tokens_neox': 474, 'n_words': 125}