<commit_before>;(function( factory ){
	if ( typeof module !== "undefined" && module && module.exports ) {
		module.exports = factory();

	} else if ( typeof define !== "function" ) {
		define( factory );

	} else {
		P = factory();
	}
})(function() {
	"use strict";

	var
		// linked list with head node - used as a queue of tasks
		// f: task, w: ticks required, n: next node
		head = { f: null, w: 0, n: null }, tail = head,

		// vars for tick re-usage
		lastIsSafe = false, pendingTicks = 0, neededTicks = 0,

		channel, // MessageChannel
		requestTick, // requestTick( onTick, 0 ) is the only valid usage!

		// window or worker
		wow = ot(typeof window) && window || ot(typeof worker) && worker;

	function onTick() {
		--pendingTicks;
		while ( head.n ) {
			head = head.n;
			neededTicks -= head.w;
			var f = head.f;
			head.f = null;
			f();
		}
		lastIsSafe = false;
	}

	function runLater( f, couldThrow ) {
		var w = 0;
		if ( !lastIsSafe && ++neededTicks > pendingTicks ) {
			++pendingTicks;
			requestTick( onTick, 0 );
			w = 1;
		};
		tail = tail.n = { f: f, w: w, n: null };
		lastIsSafe = couldThrow !== true;
	}
<commit_msg>Refactor tick re-usage.<commit_after>;(function( factory ){
	if ( typeof module !== "undefined" && module && module.exports ) {
		module.exports = factory();

	} else if ( typeof define !== "function" ) {
		define( factory );

	} else {
		P = factory();
	}
})(function() {
	"use strict";

	var
		// linked list with head node - used as a queue of tasks
		// f: task, w: needed a tick, n: next node
		head = { f: null, w: false, n: null }, tail = head,

		// vars for tick re-usage
		nextNeedsTick = true, pendingTicks = 0, neededTicks = 0,

		channel, // MessageChannel
		requestTick, // requestTick( onTick, 0 ) is the only valid usage!

		// window or worker
		wow = ot(typeof window) && window || ot(typeof worker) && worker;

	function onTick() {
		--pendingTicks;
		while ( head.n ) {
			head = head.n;
			if ( head.w ) {
				--neededTicks;
			}
			var f = head.f;
			head.f = null;
			f();
		}
		nextNeedsTick = true;
	}

	function runLater( f, couldThrow ) {
		if ( nextNeedsTick && ++neededTicks > pendingTicks ) {
			++pendingTicks;
			requestTick( onTick, 0 );
		};
		tail = tail.n = { f: f, w: nextNeedsTick, n: null };
		nextNeedsTick = couldThrow === true;
	}

{'fraction_non_alphanumeric': 0.15660051768766178, 'fraction_numerical': 0.004745470232959448, 'mean_word_length': 2.7768729641693812, 'pattern_counts': {'":': 0, '<': 3, '<?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': '24527', 'n_tokens_mistral': 917, 'n_tokens_neox': 804, 'n_words': 255}