HomePhabricator

Don't explicitly keep track of `_activeListenerCount` in the Aphlict server.

Description

Don't explicitly keep track of _activeListenerCount in the Aphlict server.

Summary: The _activeListenerCount variable is overkill, we should be able to achieve the same result using Object.keys(this._listeners).length.

Test Plan:
Mucked around in a NodeJS shell.

> Object.keys({}).length
0
> Object.keys({foo: 'bar'}).length
1
> Object.keys({1: 'foo', 2: 'bar'}).length
2

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9554

Details

Event Timeline