You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The operator elementAt could be improved in several ways:
It could request index amount upfront so it doesn't have to request(1) at every skipped value
this could be achieved with unconditional requesting in onStart() + SingleDelayedProducer or conditionally when the child subscriber actually requests a positive value(i.e., if (n > 0 && once.compareAndSet(false, true)) request(index))
Once the required element arrives, one should call this.unsubscribe() in onNext().
Note that the parent subscriber can't directly wrap the child subscriber anymore.
I'd also do a currentIndex < index check in onError in case an error happens after the indexth element and it slips through.
The text was updated successfully, but these errors were encountered:
The operator
elementAt
could be improved in several ways:index
amount upfront so it doesn't have to request(1) at every skipped valueonStart()
+SingleDelayedProducer
or conditionally when the child subscriber actually requests a positive value(i.e.,if (n > 0 && once.compareAndSet(false, true)) request(index)
)this.unsubscribe()
inonNext()
.currentIndex < index
check inonError
in case an error happens after the indexth element and it slips through.The text was updated successfully, but these errors were encountered: