Commit b552f97
committed
lib: remove unnecessary optional chain in diagnostics_channel publish()
ActiveChannel.publish() accessed this._subscribers with optional
chaining (subscribers?.length || 0). This is unnecessary because:
- _subscribers is always initialized to [] by markActive() before any
ActiveChannel method can be called
- maybeMarkInactive() sets _subscribers back to undefined only after
switching the prototype back to Channel.prototype, so ActiveChannel
methods are never reachable with a nullish _subscribers
Use subscribers.length directly.
Signed-off-by: Divyanshu Sharma <divyanshu88999@gmail.com>1 parent 6d23c3b commit b552f97
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
0 commit comments