actor: use simple comparison in LightArrayRevolverScheduler (#28981)

This commit is contained in:
Johannes Rudolph 2020-04-27 17:55:24 +02:00 committed by GitHub
parent 0e3cfbf584
commit b8df0351cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,7 +186,7 @@ class LightArrayRevolverScheduler(config: Config, log: LoggingAdapter, threadFac
private val queue = new TaskQueue private val queue = new TaskQueue
private def schedule(ec: ExecutionContext, r: Runnable, delay: FiniteDuration): TimerTask = private def schedule(ec: ExecutionContext, r: Runnable, delay: FiniteDuration): TimerTask =
if (delay <= Duration.Zero) { if (delay.length <= 0L) { // use simple comparision instead of Ordering for performance
if (stopped.get != null) throw SchedulerException("cannot enqueue after timer shutdown") if (stopped.get != null) throw SchedulerException("cannot enqueue after timer shutdown")
ec.execute(r) ec.execute(r)
NotCancellable NotCancellable