<commit_before>﻿using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;

namespace SharpTools.Testing.EntityFramework.Internal.Id
{
    [DebuggerDisplay("{_counter}", Name = "AutoIncrementingShortIdentifierGenerator")]
    internal sealed class AutoIncrementingShortIdentifierGenerator : IIdentifierGenerator
    {
        private readonly object _lock = new object();
        private short _counter;

        [MethodImpl(MethodImplOptions.Synchronized)]
        public object Generate()
        {
            lock (_lock)
            {
                if (_counter < 0)
                    _counter = 0;

                _counter++;
                return _counter;
            }
        }
    }

    [DebuggerDisplay("{_counter}", Name = "AutoIncrementingIntegerIdentifierGenerator")]
    internal sealed class AutoIncrementingIntegerIdentifierGenerator : IIdentifierGenerator
    {
        private readonly object _lock = new object();
        private int _counter;

        [MethodImpl(MethodImplOptions.Synchronized)]
        public object Generate()
        {
            lock (_lock)
            {
                if (_counter < 0)
                    _counter = 0;

                _counter++;
                return _counter;
            }
        }
    }

    [DebuggerDisplay("{_counter}", Name = "AutoIncrementingLongIdentifierGenerator")]
    internal sealed class AutoIncrementingLongIdentifierGenerator : IIdentifierGenerator
    {
        private readonly object _lock = new object();
        private long _counter;

        [MethodImpl(MethodImplOptions.Synchronized)]
        public object Generate()
        {
            lock (_lock)
            {
                if (_counter < 0)
                    _counter = 0;

                _counter++;
                return _counter;
            }
        }
    }
}<commit_msg>Remove redundant locking from AutoIncrementingIdentifierGenerators<commit_after>﻿using System.Diagnostics;
using System.Runtime.CompilerServices;

namespace SharpTools.Testing.EntityFramework.Internal.Id
{
    [DebuggerDisplay("{_counter}", Name = "AutoIncrementingShortIdentifierGenerator")]
    internal sealed class AutoIncrementingShortIdentifierGenerator : IIdentifierGenerator
    {
        private short _counter;

        [MethodImpl(MethodImplOptions.Synchronized)]
        public object Generate()
        {
            if (_counter < 0)
                _counter = 0;

            _counter++;
            return _counter;
        }
    }

    [DebuggerDisplay("{_counter}", Name = "AutoIncrementingIntegerIdentifierGenerator")]
    internal sealed class AutoIncrementingIntegerIdentifierGenerator : IIdentifierGenerator
    {
        private int _counter;

        [MethodImpl(MethodImplOptions.Synchronized)]
        public object Generate()
        {
            if (_counter < 0)
                _counter = 0;

            _counter++;
            return _counter;
        }
    }

    [DebuggerDisplay("{_counter}", Name = "AutoIncrementingLongIdentifierGenerator")]
    internal sealed class AutoIncrementingLongIdentifierGenerator : IIdentifierGenerator
    {
        private long _counter;

        [MethodImpl(MethodImplOptions.Synchronized)]
        public object Generate()
        {
            if (_counter < 0)
                _counter = 0;

            _counter++;
            return _counter;
        }
    }
}
{'fraction_non_alphanumeric': 0.07622130665097115, 'fraction_numerical': 0.003531489111241907, 'mean_word_length': 2.073236889692586, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '6724529', 'n_tokens_mistral': 826, 'n_tokens_neox': 784, 'n_words': 180}