<commit_before>﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VBF.Compilers
{
    public class CompilationErrorList : IReadOnlyList<CompilationError>
    {
        private List<CompilationError> m_errors;
        private CompilationErrorManager m_errorManager;

        public void AddError(int id, SourceSpan errorPosition, params object[] args)
        {
            CodeContract.RequiresArgumentInRange(m_errorManager.ContainsErrorDefinition(id), "id", "Error id is invalid");

            var errorInfo = m_errorManager.GetErrorInfo(id);
            var errorMessage = String.Format(errorInfo.MessageTemplate, args);

            m_errors.Add(new CompilationError(errorInfo, errorPosition, errorMessage));
        }

        public CompilationError this[int index]
        {
            get { return m_errors[index]; }
        }

        public int Count
        {
            get { return m_errors.Count; }
        }

        public IEnumerator<CompilationError> GetEnumerator()
        {
            foreach (var item in m_errors)
            {
                yield return item;
            }
        }

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

        public CompilationErrorList(CompilationErrorManager errorManager)
        {
            CodeContract.RequiresArgumentNotNull(errorManager, "errorManager");
            m_errors = new List<CompilationError>();
            m_errorManager = errorManager;
        }

        internal ReadOnlyCollection<CompilationError> AsReadOnly()
        {
            return m_errors.AsReadOnly();
        }

        internal void Clear()
        {
            m_errors.Clear();
        }
    }
}<commit_msg>Remove unnecessary code<commit_after>﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VBF.Compilers
{
    public class CompilationErrorList : IReadOnlyList<CompilationError>
    {
        private List<CompilationError> m_errors;
        private CompilationErrorManager m_errorManager;

        public void AddError(int id, SourceSpan errorPosition, params object[] args)
        {
            CodeContract.RequiresArgumentInRange(m_errorManager.ContainsErrorDefinition(id), "id", "Error id is invalid");

            var errorInfo = m_errorManager.GetErrorInfo(id);
            var errorMessage = String.Format(errorInfo.MessageTemplate, args);

            m_errors.Add(new CompilationError(errorInfo, errorPosition, errorMessage));
        }

        public CompilationError this[int index]
        {
            get { return m_errors[index]; }
        }

        public int Count
        {
            get { return m_errors.Count; }
        }

        public IEnumerator<CompilationError> GetEnumerator()
        {
            foreach (var item in m_errors)
            {
                yield return item;
            }
        }

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

        public CompilationErrorList(CompilationErrorManager errorManager)
        {
            CodeContract.RequiresArgumentNotNull(errorManager, "errorManager");
            m_errors = new List<CompilationError>();
            m_errorManager = errorManager;
        }
    }
}
{'fraction_non_alphanumeric': 0.0772919605077574, 'fraction_numerical': 0.0, 'mean_word_length': 2.3140186915887853, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '975977', 'n_tokens_mistral': 899, 'n_tokens_neox': 895, 'n_words': 187}