<commit_before><?php
namespace autoauth\filters;

final class URLDecode extends \autoauth\util\Filterer
{
	private static function split($string)
	{
		if(is_int($offset = strpos($string, '%', max(0, strlen($string) - 2))))
			return \autoauth\util\Strings::slice($string, $offset);
		else
			return [$string, null];
	}

	protected function filterer($eof)
	{
		static $partial;

		while($data = $this->read())
		{
			list($full, $partial) = self::split($partial . $data);
			$this->write(rawurldecode($full));
		}

		if($eof)
			$this->write(rawurldecode($partial));

		return true;
	}
}<commit_msg>No longer need that check since Strings::slice can now handle false/null<commit_after><?php
namespace autoauth\filters;

final class URLDecode extends \autoauth\util\Filterer
{
	private static function split($string)
	{
		$offset = strpos($string, '%', max(0, strlen($string) - 2));
		return \autoauth\util\Strings::slice($string, $offset);
	}

	protected function filterer($eof)
	{
		static $partial;

		while($data = $this->read())
		{
			list($full, $partial) = self::split($partial . $data);
			$this->write(rawurldecode($full));
		}

		if($eof)
			$this->write(rawurldecode($partial));

		return true;
	}
}
{'fraction_non_alphanumeric': 0.17452440033085195, 'fraction_numerical': 0.0033085194375516956, 'mean_word_length': 4.601851851851852, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2365053', 'n_tokens_mistral': 457, 'n_tokens_neox': 418, 'n_words': 86}