<commit_before>module.exports = function (bufs, url) {
    var ix = indexOf(bufs, ' ', 0, 0);
    var jx = indexOf(bufs, ' ', ix[0], ix[1] + 1);
    
    var before = bufs[ix[0]].slice(0, ix[1] + 1);
    var after = bufs[jx[0]].slice(jx[1]);
    var middle = Buffer.isBuffer(url) ? url : new Buffer(url);
    
    bufs.splice(ix[0], jx[0] + 1, before, middle, after);
    
    return jx[2] - middle.length;
};
<commit_msg>all tests pass for url rewriting<commit_after>module.exports = function (bufs, url) {
    var ix = indexOf(bufs, ' ', 0, 0);
    var jx = indexOf(bufs, ' ', ix[0], ix[1] + 1);
    
    var before = bufs[ix[0]].slice(0, ix[1] + 1);
    var after = bufs[jx[0]].slice(jx[1]);
    var middle = Buffer.isBuffer(url) ? url : new Buffer(url);
    
    bufs.splice(ix[0], jx[0] - ix[0] + 1, before, middle, after);
    
    return jx[2] - middle.length;
};

{'fraction_non_alphanumeric': 0.19862227324913892, 'fraction_numerical': 0.03559127439724455, 'mean_word_length': 2.9457013574660635, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2529922', 'n_tokens_mistral': 381, 'n_tokens_neox': 361, 'n_words': 82}