<commit_before>﻿using System.Collections.Concurrent;
using System.Collections.Generic;

namespace Tilemaps.Behaviours.Meta
{
	public class UniqueQueue<T> : IEnumerable<T>
	{
		private HashSet<T> hashSet;
		private ConcurrentQueue<T> queue;

		public UniqueQueue()
		{
			hashSet = new HashSet<T>();
			queue = new ConcurrentQueue<T>();
		}

		public int Count => hashSet.Count;

		public bool Contains(T item)
		{
			return hashSet.Contains(item);
		}

		public void Enqueue(T item)
		{
			lock (hashSet)
			{
				if (hashSet.Add(item))
				{
					queue.Enqueue(item);
				}
			}
		}

		public void EnqueueAll(IEnumerable<T> elements)
		{
			foreach (T e in elements)
			{
				Enqueue(e);
			}
		}

		public bool TryDequeue(out T item)
		{
			if (queue.TryDequeue(out item))
			{
				lock (hashSet)
				{
					hashSet.Remove(item);
				}

				return true;
			}

			return false;
		}

		public T Peek()
		{
			T item;
			queue.TryPeek(out item);
			return item;
		}

		public IEnumerator<T> GetEnumerator()
		{
			return queue.GetEnumerator();
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return queue.GetEnumerator();
		}

		public bool IsEmpty => queue.IsEmpty;
	}
}<commit_msg>UniqueQueue: foreach -> for loop<commit_after>﻿using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;

namespace Tilemaps.Behaviours.Meta
{
	public class UniqueQueue<T> : IEnumerable<T>
	{
		private HashSet<T> hashSet;
		private ConcurrentQueue<T> queue;

		public UniqueQueue()
		{
			hashSet = new HashSet<T>();
			queue = new ConcurrentQueue<T>();
		}

		public int Count => queue.Count;

		public bool IsEmpty => queue.IsEmpty;

		public bool Contains(T item)
		{
			lock (hashSet)
			{
				return hashSet.Contains(item);
			}
		}

		public void Enqueue(T item)
		{
			lock (hashSet)
			{
				if (hashSet.Add(item))
				{
					queue.Enqueue(item);
				}
			}
		}

		public void EnqueueAll(List<T> elements)
		{
			for (int i = 0; i < elements.Count; i++)
			{
				Enqueue(elements[i]);
			}
		}

		public bool TryDequeue(out T item)
		{
			if (queue.TryDequeue(out item))
			{
				lock (hashSet)
				{
					hashSet.Remove(item);
				}

				return true;
			}

			return false;
		}

		public T Peek()
		{
			T item;
			queue.TryPeek(out item);
			return item;
		}

		public IEnumerator<T> GetEnumerator()
		{
			return queue.GetEnumerator();
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return queue.GetEnumerator();
		}
	}
}
{'fraction_non_alphanumeric': 0.12149901380670611, 'fraction_numerical': 0.0003944773175542406, 'mean_word_length': 2.8776758409785934, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 24, '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': '6745563', 'n_tokens_mistral': 1134, 'n_tokens_neox': 909, 'n_words': 189}