Unverified Commit fd166a87 authored by Anatoli Papirovski's avatar Anatoli Papirovski
Browse files

events: return values directly in listeners

Each conditional branch in EventEmitter.prototype.listeners assigns
its return value to a variable ret which is returned at the end.
Instead just return from within each branch. This is both clearer
and more performant.

events/ee-listeners.js n=5000000      3.65 %        *** 3.359171e-10

PR-URL: https://github.com/nodejs/node/pull/16212


Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarRefael Ackermann <refack@gmail.com>
parent c8d4ff1d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment