Skip to content

Assorted RigidArray/UniqueArray updates#569

Merged
lorentey merged 20 commits intoapple:mainfrom
lorentey:array-updates
Feb 6, 2026
Merged

Assorted RigidArray/UniqueArray updates#569
lorentey merged 20 commits intoapple:mainfrom
lorentey:array-updates

Conversation

@lorentey
Copy link
Member

@lorentey lorentey commented Feb 3, 2026

  • Sort source files into subdirectories
  • Rename replaceSubrange(_:...) methods with replace(removing:...).
  • Rename copy()/copy(capacity:) to clone()/clone(capacity:), deprecating the old entry points.
  • Add basic Equatable/Hashable/Custom[Debug]StringConvertible implementations. Generalized conformances are pending the Swift 6.4 release.
  • Add RigidArray.distance(from:to:). Fill out doc strings for index navigation methods.
  • Add UniqueArray index navigation methods.
  • More test coverage, resolving small logic errors
  • Update docs

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexplained benchmark regressions.
  • I've updated the documentation if necessary.

@lorentey lorentey added this to the 1.4.0 milestone Feb 3, 2026
…t once”

Loosen guarantees about how many times closure arguments are getting called, so that e.g. insertions of zero items do not necessarily need to call their callback with an empty OutputSpan.

(For these array types we can reinstate the guarantee later, if it turns out to be important/useful. However, the generalized primitives will need to allow their callbacks to get called an arbitrary number of times, and it seems useful to establish that (at least partially) with these simple array types too.)
More uniform message strings should feel better, and they should ever so slightly reduce code size.
Drain-returning variants will need to be added on RigidArray/UniqueArray later.
…vertible operations

Currently these are all conditional on copyable elements, and the types cannot conform to the actual protocols yet.
@lorentey lorentey force-pushed the array-updates branch 2 times, most recently from c79d712 to f29817c Compare February 5, 2026 22:33
@lorentey lorentey merged commit 324439a into apple:main Feb 6, 2026
28 checks passed
@lorentey lorentey deleted the array-updates branch February 6, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant