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

namespace CommonMark
{
    /// <summary>
    /// Methods from BString library that are used to ease the conversion from C code.
    /// These are mainly used because the naming of the methods are easy to confuse and errors might 
    /// be introduced if the calls would be modified right away during the porting process.
    /// </summary>
    internal static class BString
    {
        public static char? bchar(string data, int pos)
        {
            if (data.Length <= pos)
                return null;
            return data[pos];
        }

        /// <summary>
        /// Inserts the bstring s2 into s1 at position pos.  If the position pos is 
        /// past the end of s1, then the character "fill" is appended as necessary to 
        /// make up the gap between the end of s1 and pos.  The value BSTR_OK is 
        /// returned if the operation is successful, otherwise BSTR_ERR is returned.
        /// </summary>
        public static void binsert (ref string s1, int pos, string s2, char fill)
        {
            while (s1.Length < pos)
                s1 += fill;
            s1 = s1.Insert(pos, s2);
        }
<commit_msg>On 4.5 force inline of `bchar`<commit_after>﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CommonMark
{
    /// <summary>
    /// Methods from BString library that are used to ease the conversion from C code.
    /// These are mainly used because the naming of the methods are easy to confuse and errors might 
    /// be introduced if the calls would be modified right away during the porting process.
    /// </summary>
    internal static class BString
    {
#if OptimizeFor45
        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
#endif
        public static char? bchar(string data, int pos)
        {
            if (data.Length <= pos)
                return null;
            return data[pos];
        }

        /// <summary>
        /// Inserts the bstring s2 into s1 at position pos.  If the position pos is 
        /// past the end of s1, then the character "fill" is appended as necessary to 
        /// make up the gap between the end of s1 and pos.  The value BSTR_OK is 
        /// returned if the operation is successful, otherwise BSTR_ERR is returned.
        /// </summary>
        public static void binsert (ref string s1, int pos, string s2, char fill)
        {
            while (s1.Length < pos)
                s1 += fill;
            s1 = s1.Insert(pos, s2);
        }

{'fraction_non_alphanumeric': 0.08115282518012894, 'fraction_numerical': 0.009859689040576413, 'mean_word_length': 1.9909297052154196, 'pattern_counts': {'":': 0, '<': 15, '<?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': '5285134', 'n_tokens_mistral': 711, 'n_tokens_neox': 683, 'n_words': 307}