<commit_before><?php

function vlq_encode( $input ) {
	$out    = array_map( function ( $b ) {
		return 0b10000000 | bindec( $b );
	}, array_reverse( str_split( decbin( $input[0] ), 7 ) ) );
	$out[0] &= 0b01111111;

	return array_reverse( $out );
}<commit_msg>Problem 31: refactor<commit_after><?php

function vlq_encode( $input ) {
	$out                 = array_map( function ( $b ) {
		return ( 0b10000000 | bindec( $b ));
	}, split( decbin( $input[0] )) );
	$out[sizeof($out)-1] &= 0b01111111;

	return ( $out );
}

function split( $str ) {
	$out = array();
	while ( strlen( $str ) > 0 ) {
		array_push( $out, substr( $str, 0, 7 ) );
		$str = substr( $str, 7 );
	}

	return $out;
}
{'fraction_non_alphanumeric': 0.19472913616398244, 'fraction_numerical': 0.06881405563689605, 'mean_word_length': 3.412903225806452, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '6987586', 'n_tokens_mistral': 313, 'n_tokens_neox': 274, 'n_words': 64}