<commit_before>{_} = require "./Underscore"

EventEmitterEventsKey = "_events"

class exports.EventEmitter
	
	constructor: ->
		@[EventEmitterEventsKey] = {}

	_eventCheck: (event, method) ->
		if not event
			console.warn "#{@constructor.name}.#{method} missing event (like 'click')"

	emit: (event, args...) ->
		
		# We skip it here because we need all the perf we can get
		# @_eventCheck event, "emit"

		if not @[EventEmitterEventsKey]?[event]
			return
		
		for listener in @[EventEmitterEventsKey][event]
			listener args...
		
		return
<commit_msg>Perf optimizations<commit_after>{_} = require "./Underscore"

EventEmitterEventsKey = "_events"

class exports.EventEmitter
	
	constructor: ->
		@[EventEmitterEventsKey] = {}

	_eventCheck: (event, method) ->
		if not event
			console.warn "#{@constructor.name}.#{method} missing event (like 'click')"

	emit: (event, arg1, arg2, arg3, arg4) ->
		
		# We skip it here because we need all the perf we can get
		# @_eventCheck event, "emit"

		if @[EventEmitterEventsKey] and @[EventEmitterEventsKey].hasOwnProperty(event)
			for listener in @[EventEmitterEventsKey][event]
				listener(arg1, arg2, arg3, arg4)

		return 0

{'fraction_non_alphanumeric': 0.1298811544991511, 'fraction_numerical': 0.007640067911714771, 'mean_word_length': 4.103896103896104, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7217782', 'n_tokens_mistral': 419, 'n_tokens_neox': 382, 'n_words': 109}