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
Andreas left a nice list of improvements needed for the subsequence code here, which I've included as a check-list below.
Start and end are insufficiently checked. It is quite easy to generate a subsequence of negative size by subsequence(foo, start: 5, end: 3).
Also, passing a negative start gives access to data outside the subsequence the user is allowed to see.
The semantics of omitting the sequence end isn't well-defined, especially given stretchy source sequences.
The good news: the above problems are not exploitable because everything is bounds-checked twice.
The bad news: the performance leaves to be desired because everything is bounds-checked twice.
Design decision: signal bounds error at subsequence creation time vs. element access time. The latter is more dynamic, the former gives better performance.
Feature wish: Read-only subsequences.
The text was updated successfully, but these errors were encountered:
Andreas left a nice list of improvements needed for the subsequence code here, which I've included as a check-list below.
The text was updated successfully, but these errors were encountered: