<commit_before>package net.raboof.leftpad;

import java.util.function.Function;

public class LeftPad implements Function<CharSequence, String> {
    private final int length;
    private final char fill;

    public LeftPad(int length, char fill) {
        this.length = length;
        this.fill = fill;
    }

    public LeftPad(int length) {
        this(length, ' ');
    }

    public String apply(CharSequence inputString) {
        StringBuilder output = new StringBuilder();

        int i = -1;

        int len = length - inputString.length();

        while (i++ < len) {
            output.append(fill);
        }

        output.append(inputString);

        return output.toString();
    }
}
<commit_msg>fix off-by-one bug<commit_after>package net.raboof.leftpad;

import java.util.function.Function;

public class LeftPad implements Function<CharSequence, String> {
    private final int length;
    private final char fill;

    public LeftPad(int length, char fill) {
        this.length = length;
        this.fill = fill;
    }

    public LeftPad(int length) {
        this(length, ' ');
    }

    public String apply(CharSequence inputString) {
        StringBuilder output = new StringBuilder();

        int i = -1;

        int len = length - inputString.length();

        while (++i < len) {
            output.append(fill);
        }

        output.append(inputString);

        return output.toString();
    }
}

{'fraction_non_alphanumeric': 0.10395010395010396, 'fraction_numerical': 0.001386001386001386, 'mean_word_length': 2.259593679458239, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '1682070', 'n_tokens_mistral': 413, 'n_tokens_neox': 396, 'n_words': 108}