Commit Graph

13 Commits

Author SHA1 Message Date
David Farler
f924e8e007 ArraySlice indexes no longer zero-based
ArraySlice indices now map directly onto the collection it is slicing
and maintains that mapping even after mutations.

Before:

var a = Array(0..<10)
var s = a[5..<10]
s.indices        // 0..<5
s[0] = 111
s                // [111, 6, 7, 8, 9]
s.removeFirst()
s.indices        // 1..<5

After:

var a = Array(0..<10)
var s = a[5..<10]
s.indices        // 5..<10
s[5] = 99
s                // [99, 6, 7, 8, 9]
s.removeFirst()
s.indices        // 6..<10

- Refactor some of the internals of the buffer types to make it easier
  to read and understand.
- Add Array, ArraySlice, and ContiguousArray to the test suite at the
  RangeReplaceable test entry points, subjecting them to the same tests
  as all of our collections.
- Update existing test expectations for the indexing changes.

rdar://problem/21866825

Swift SVN r30840
2015-07-31 03:25:29 +00:00
Dmitri Hrybenko
acdd8772be stdlib: update the doc comment to the new 'as!' syntax
Swift SVN r29054
2015-05-27 03:40:33 +00:00
Dmitri Hrybenko
77c76071f2 stdlib: fix coding style
Swift SVN r29012
2015-05-25 19:16:18 +00:00
Dmitri Hrybenko
d8d50e1815 stdlib: in Array bridging code, use the same pattern as Set and Dictionary use
Also, simplify the code by removing an unused parameter.  NFC.

Swift SVN r28607
2015-05-15 03:44:37 +00:00
Dmitri Hrybenko
68ef59e37a stdlib: Convert comments to use '- requires:' instead of 'Requires:'.
Tidy misc. comments and markdown along the way.

Patch by Brian Lanier.

Swift SVN r28473
2015-05-12 17:47:11 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Dave Abrahams
106b39a497 [stdlib] Indent bullet continuations in doc comments
The text is a lot more readable that way.

Swift SVN r28471
2015-05-12 16:59:08 +00:00
Chris Lattner
c1df892d47 improve stdlib hygiene a bit.
Swift SVN r28392
2015-05-10 02:55:18 +00:00
Dmitri Hrybenko
8b392eeea9 Revert "Remove Array.count, it is redundant with protocol extensions"
This reverts commit r28247 while we discuss the change.

Swift SVN r28292
2015-05-07 21:45:30 +00:00
Dmitri Hrybenko
58601fafc8 Remove Array.count, it is redundant with protocol extensions
Swift SVN r28247
2015-05-07 00:30:41 +00:00
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +00:00
Chris Willmore
c7c7388cf2 Change do-while to repeat-while.
Change all uses of "do { ... } while <cond>" to use "repeat" instead.
Rename DoWhileStmt to RepeatWhileStmt. Add diagnostic suggesting change
of 'do' to 'repeat' if a condition is found afterwards.

<rdar://problem/20336424> rename do/while loops to repeat/while & introduce "repeat <count> {}" loops

Swift SVN r27650
2015-04-23 22:48:31 +00:00
Dmitri Hrybenko
350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00