[SR-7785] Complexity of dropFirst/dropLast on RandomAccessCollection #50324
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
documentation
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: cd47f573c0e3209654ce7041b06b2c8a
Issue Description:
The documentation is wrong about of the complexity of dropFirst/dropLast for the Array type:
For arrays (or generally for RandomAccessCollection) the complexity is O(1), independent of the collection size or the number of elements to drop.
Related discussion in the Swift Forum: dropLast() vs. dropLast(1) for arrays
The text was updated successfully, but these errors were encountered: