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
I came across the someProperty method in SC.Enumerable (https://github.com/sproutcore/sproutcore/blob/master/frameworks/runtime/mixins/enumerable.js#L588), and I was wondering why it doesn't have a fast path. I would expect that if one item was found to be matching, it can return immediately.
I didn't test this, but while I can imagine the extra check in the loop to be relatively expensive for small arrays, I would think that for larger arrays it could provide a speed up.
Thoughts?
The text was updated successfully, but these errors were encountered:
someProperty doesn't seem to be used in SC, and since I don't use it either, I can't help you much with that...
But returning true as soon as an item is found indeed sound like a good idea.
I came across the someProperty method in SC.Enumerable (https://github.com/sproutcore/sproutcore/blob/master/frameworks/runtime/mixins/enumerable.js#L588), and I was wondering why it doesn't have a fast path. I would expect that if one item was found to be matching, it can return immediately.
I didn't test this, but while I can imagine the extra check in the loop to be relatively expensive for small arrays, I would think that for larger arrays it could provide a speed up.
Thoughts?
The text was updated successfully, but these errors were encountered: