<commit_before>using System;

namespace MapParse.Types
{
	/// <summary>
	/// An array that can be added to at runtime.
	/// </summary>
	public class DynamicArray<T>
	{
		public T[] Elements { get; set; }
		public int Length
		{
			get
			{
				return Elements.Length;
			}
		}
		
		public DynamicArray()
		{
			this.Elements = new T[0];
		}
		public DynamicArray(int length)
		{
			this.Elements = new T[length];
		}
		
		/// <summary>
		/// Add an element to the end of the array.
		/// </summary>
		public void Add(T element)
		{
			T[] newArray = new T[Length + 1]; // maybe need to +2 here due to zero-indexing
			newArray[Length] = element;
			Elements = newArray;
		}
		
		public T this[int index]
		{
			get
			{
				return this.Elements[index];
			}
			set
			{
				this.Elements[index] = value;
			}
		}

		public static bool operator== (DynamicArray<T> a, DynamicArray<T> b)
		{
			if (a.Length == b.Length)
			{
				if (a.Elements == b.Elements)
				{
					return true;
				}
			}<commit_msg>Made Add method copy the previous array instead of just throwing it away<commit_after>using System;

namespace MapParse.Types
{
	/// <summary>
	/// An array that can be added to at runtime.
	/// </summary>
	public class DynamicArray<T>
	{
		public T[] Elements { get; set; }
		public int Length
		{
			get
			{
				return Elements.Length;
			}
		}
		
		public DynamicArray()
		{
			this.Elements = new T[0];
		}
		public DynamicArray(int length)
		{
			this.Elements = new T[length];
		}
		
		/// <summary>
		/// Add an element to the end of the array.
		/// </summary>
		public void Add(T element)
		{
			T[] newArray = new T[Length + 1];
			for (int i = 0; i < Length; i++)
			{
				newArray[i] = Elements[i];
			}
			newArray[Length] = element;
			Elements = newArray;
		}
		
		public T this[int index]
		{
			get
			{
				return this.Elements[index];
			}
			set
			{
				this.Elements[index] = value;
			}
		}

		public static bool operator== (DynamicArray<T> a, DynamicArray<T> b)
		{
			if (a.Length == b.Length)
			{
				if (a.Elements == b.Elements)
				{
					return true;
				}
			}
{'fraction_non_alphanumeric': 0.13358778625954199, 'fraction_numerical': 0.0028625954198473282, 'mean_word_length': 2.226153846153846, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 17, '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': '5310580', 'n_tokens_mistral': 929, 'n_tokens_neox': 727, 'n_words': 209}