<commit_before>package org.builditbreakit.seada.common.data;

import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public final class Visitor implements Serializable {
	private static final long serialVersionUID = -8422758600278331225L;
	
	private transient final String name;
	private transient final List<LocationRecord> history;

	public Visitor(String name) {
		ValidationUtil.assertValidVisitorName(name);
		
		this.name = name;
		this.history = new LinkedList<>();
	}
	
	private Visitor(String name, List<LocationRecord> history) {
		ValidationUtil.assertValidVisitorName(name);
		ValidationUtil.assertNotNull(history, "History");
		
		this.name = name;
		this.history = new LinkedList<>(history);
	}

	public Location getCurrentLocation() {
		if(history.isEmpty()) {
			return Location.OFF_PREMISES;
		}
		return history.get(history.size() - 1).getLocation();<commit_msg>Optimize by switching from LinkedList to ArrayList<commit_after>package org.builditbreakit.seada.common.data;

import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public final class Visitor implements Serializable {
	private static final long serialVersionUID = -8422758600278331225L;
	
	private transient final String name;
	private transient final List<LocationRecord> history;

	public Visitor(String name) {
		ValidationUtil.assertValidVisitorName(name);
		
		this.name = name;
		this.history = new ArrayList<>();
	}
	
	private Visitor(String name, List<LocationRecord> history) {
		ValidationUtil.assertValidVisitorName(name);
		ValidationUtil.assertNotNull(history, "History");
		
		this.name = name;
		this.history = new ArrayList<>(history);
	}

	public Location getCurrentLocation() {
		if(history.isEmpty()) {
			return Location.OFF_PREMISES;
		}
		return history.get(history.size() - 1).getLocation();
{'fraction_non_alphanumeric': 0.1002921129503408, 'fraction_numerical': 0.019474196689386564, 'mean_word_length': 5.482649842271293, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5155689', 'n_tokens_mistral': 657, 'n_tokens_neox': 583, 'n_words': 139}