async-interop / event-loop

An event loop interface for interoperability in PHP.
MIT License
170 stars 9 forks source link

Most methods in Loop checks for self::$driver else checks inside self::get() #143

Closed brzuchal closed 7 years ago

brzuchal commented 7 years ago

Most of Loop mehtods have the same expression $driver = self::$driver ?: self::get(); according to self::get() declaration there another check inside method if (self::$driver) whats the purpose of double check for driver already been set?

kelunik commented 7 years ago

The purpose here is saving a method call for maximum performance.

brzuchal commented 7 years ago

Nice, I didn't know that hack.I'm closing due to fact that it actually is not an issue if so.