<commit_before>define([
	'goo/entities/systems/System'
],
/** @lends */
function (System) {
	"use strict";

	/**
	 * @class Processes all entities with transform components, making sure they are up to date and valid according to the "scenegraph"
	 * @extends System
	 */
	function TransformSystem() {
		System.call(this, 'TransformSystem', ['TransformComponent']);
		this.numUpdates = 0;
	}

	TransformSystem.prototype = Object.create(System.prototype);

	TransformSystem.prototype.process = function (entities) {
		this.numUpdates = 0;
		var i, transformComponent;
		for (i = 0; i < entities.length; i++) {
			transformComponent = entities[i].transformComponent;
			transformComponent._updated = false;
			if (transformComponent._dirty) {
				transformComponent.updateTransform();
			}
		}

		for (i = 0; i < entities.length; i++) {
			entities[i].transformComponent._updated2 = false;
		}

		for (i = 0; i < entities.length; i++) {
			transformComponent = entities[i].transformComponent;
			if (transformComponent._dirty) {
				this.updateWorldTransform(transformComponent);
			}
		}

		for (i = 0; i < entities.length; i++) {
			transformComponent = entities[i].transformComponent;
			if (transformComponent._dirty) {
				transformComponent.updateWorldTransform();
			}
		}
	};

	TransformSystem.prototype.updateWorldTransform = function (transformComponent) {
		if (!transformComponent._updated2 && ((transformComponent.parent === null) || (transformComponent.parent && transformComponent.parent._updated2))) {
			this.numUpdates++;
			transformComponent.updateWorldTransform();
			transformComponent._updated2 = true;
		} else {
			// No need to update children
			return;
		}

		for (var i = 0; i < transformComponent.children.length; i++) {
			this.updateWorldTransform(transformComponent.children[i]);
		}
	};

	return TransformSystem;
});<commit_msg>reverted TransformSystem optimization, needs more testing https://trello.com/c/GAimeX1s/1428-engine-optimization<commit_after>define(['goo/entities/systems/System'],
	/** @lends */
	function (System) {
	"use strict";

	/**
	 * @class Processes all entities with transform components, making sure they are up to date and valid according to the "scenegraph"
	 * @extends System
	 */
	function TransformSystem() {
		System.call(this, 'TransformSystem', ['TransformComponent']);
	}

	TransformSystem.prototype = Object.create(System.prototype);

	TransformSystem.prototype.process = function (entities) {
		var i, transformComponent;
		for (i = 0; i < entities.length; i++) {
			transformComponent = entities[i].transformComponent;
			transformComponent._updated = false;
			if (transformComponent._dirty) {
				transformComponent.updateTransform();
			}
		}
		for (i = 0; i < entities.length; i++) {
			transformComponent = entities[i].transformComponent;
			if (transformComponent._dirty) {
				this.updateWorldTransform(transformComponent);
			}
		}
	};

	TransformSystem.prototype.updateWorldTransform = function (transformComponent) {
		transformComponent.updateWorldTransform();

		for (var i = 0; i < transformComponent.children.length; i++) {
			this.updateWorldTransform(transformComponent.children[i]);
		}
	};

	return TransformSystem;
});
{'fraction_non_alphanumeric': 0.12761310452418095, 'fraction_numerical': 0.00592823712948518, 'mean_word_length': 4.518072289156627, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '5206559', 'n_tokens_mistral': 1026, 'n_tokens_neox': 898, 'n_words': 204}