-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get firstObject/lastObject notifications only when cached #14493
Conversation
@krisselden / @rwjblue should this ride canary or be a |
b9460b4
to
c480beb
Compare
I think we can go with |
1074c9f
to
3c4c08f
Compare
going to sleep, i'll fix tests and address feedback when I wake up. |
3c4c08f
to
4fa699a
Compare
…when cached Basically the contents of https://gist.github.com/mmun/877bad33158578a8609b
4fa699a
to
03b9dbc
Compare
@krisselden should we:
|
@stefanpenner it is currently already more like the set() strategy, it was just doing it before firstObject and lastObject were ever consumed which is what this is addressing. I lean toward landing it as is and proposing considering the other changes after |
@krisselden sounds good, we can always switch to the more CP style by checking affected array offsets in the future. |
Basically the contents of https://gist.github.com/mmun/877bad33158578a8609b
[fixes #5591]
changed:
to:
this lets us skip needing to re-fetch the cache (we just did above), but not leak the sentinel
UNDEFINED
value (which is why we have the methods in the first place.objectAt(array, index)
andthis
toarray
length
lazy unlesslastObject
needs accessing