Skip to content

Commit f0d294b

Browse files
committed
Merge pull request #884 from practicalswift/apostrophes
[gardening] Replace left/right quotation marks
2 parents 1915b06 + 4d43f4a commit f0d294b

14 files changed

+36
-36
lines changed

docs/ARCOptimization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ lower directly to is_unique instructions in SIL.
137137
The is_unique instruction takes the address of a reference, and
138138
although it does not actually change the reference, the reference must
139139
appear mutable to the optimizer. This forces the optimizer to preserve
140-
a retain distinct from whats required to maintain lifetime for any of
140+
a retain distinct from what's required to maintain lifetime for any of
141141
the reference's source-level copies, because the called function is
142142
allowed to replace the reference, thereby releasing the
143143
referent. Consider the following sequence of rules:
@@ -225,7 +225,7 @@ these cases:
225225
- isUniqueOrPinned_native : <T> (inout T[?]) -> Int1
226226

227227
These builtins perform an implicit cast to NativeObject before
228-
checking uniqueness. Theres no way at SIL level to cast the address
228+
checking uniqueness. There's no way at SIL level to cast the address
229229
of a reference, so we need to encapsulate this operation as part of
230230
the builtin.
231231

docs/ErrorHandlingRationale.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,15 +1359,15 @@ declaration or type::
13591359
return try stream.readInt()
13601360
}
13611361
1362-
// throws is written before the arrow to give a sensible and
1362+
// 'throws' is written before the arrow to give a sensible and
13631363
// consistent grammar for function types and implicit () result types.
13641364
func baz() throws {
13651365
if let byte = try stream.getOOB() where byte == PROTO_RESET {
13661366
reset()
13671367
}
13681368
}
13691369
1370-
// throws appears in a consistent position in function types.
1370+
// 'throws' appears in a consistent position in function types.
13711371
func fred(callback: (UInt8) throws -> ()) throws {
13721372
while true {
13731373
let code = try stream.readByte()
@@ -1380,7 +1380,7 @@ declaration or type::
13801380
// this function has type:
13811381
// (Int) -> (Int) throws -> Int
13821382
func jerry(i: Int)(j: Int) throws -> Int {
1383-
// Its not an error to use throws on a function that cant throw.
1383+
// It's not an error to use 'throws' on a function that can't throw.
13841384
return i + j
13851385
}
13861386

docs/GitWorkflows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ transition to Git this document helps to address questions about how common SVN
1111
workflows we use today translate to their Git counterparts as well as to discuss
1212
Git workflow practices we plan on having — at least initially — after the Git
1313
transition. Notably we will follow a model where commits to trunk — which is
14-
the master branch in Git — has commits land (in the common case) via rebasing
14+
the 'master' branch in Git — has commits land (in the common case) via rebasing
1515
instead of merging. This model is open to evolution later, but this mimics the
1616
workflow we have today with SVN.
1717

docs/MutationModel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Consider::
4040
w.title += " (parenthesized remark)"
4141

4242
What do we do with this? Since ``+=`` has an ``inout`` first
43-
argument, we detect this situation statically (hopefully one day well
43+
argument, we detect this situation statically (hopefully one day we'll
4444
have a better error message):
4545

4646
::
@@ -53,7 +53,7 @@ Great. Now what about this? [#append]_ ::
5353

5454
w.title.append(" (fool the compiler)")
5555

56-
Today, we allow it, but since theres no way to implement the
56+
Today, we allow it, but since there's no way to implement the
5757
write-back onto ``w.title``, the changes are silently dropped.
5858

5959
Unsatisfying Approaches

docs/OptimizationTips.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ do not have any overriding declarations in the same file:
157157
func usingE(e: E) {
158158
e.doSomething() // There is no sub class in the file that declares this class.
159159
// The compiler can remove virtual calls to doSomething()
160-
// and directly call As doSomething method.
160+
// and directly call A's doSomething method.
161161
}
162162

163163
func usingF(f: F) -> Int {

docs/OptimizerDesign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ This is an example of the *@_semantics* attribute as used by Swift Array:
180180

181181
Notice that as soon as we inline functions that have the @_semantics attribute
182182
the attribute is lost and the optimizer can't analyze the content of the
183-
function. For example, the optimizer can identify the array count' method (that
183+
function. For example, the optimizer can identify the array 'count' method (that
184184
returns the size of the array) and can hoist this method out of loops. However,
185185
as soon as this method is inlined, the code looks to the optimizer like a memory
186186
read from an undetermined memory location, and the optimizer can't optimize the

docs/proposals/CompressedMangledNames.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ compiler and make an effort to optimize and shrink the generated binaries. One
77
of the problems that we have today is that swift symbols are mangled into
88
extremely long strings. This is especially a problem for libraries, and almost
99
half of the size of libswiftCore.dylib (the swift runtime library on x86_64 OSX)
10-
is string tables. On MacOSX you can use the command size -m file.dylib to read
10+
is string tables. On MacOSX you can use the command "size -m file.dylib" to read
1111
the size of the string table. C++ also suffers from the problem of long names,
1212
but since we control the Swift ABI we can do better than C++.
1313

@@ -99,15 +99,15 @@ the top 63 frequent substrings in our dictionary using two characters (escape +
9999
The second escape character encodes a two-character reference that can access 63 x 63 entries in the table.
100100
Less common substrings can be encoded using this three character sequence (escape + index0 + index1).
101101

102-
One interesting bit of information is that the character ‘Y’ is only used 4
102+
One interesting bit of information is that the character "Y" is only used 4
103103
times in the entire standard library! The letter J, and a few other letters are
104104
also not used very frequently. We use Y and J as escape characters.
105105

106106
The dictionary-based encoding uses the following rules:
107107

108108
1. We use two escape characters that are not frequently used in names (Y and Z).
109109
These characters are escape character and cannot be used as part of the text
110-
without escaping. ‘Y’ is encoded as ‘YY’, and ‘Z’ would be encoded as ‘YZ’.
110+
without escaping. "Y" is encoded as "YY", and "Z" would be encoded as "YZ".
111111

112112
2. The most commonly used sub-strings (calculated as length of substring times
113113
number of occurrences) is encoded with a single escape character and a
@@ -216,7 +216,7 @@ Error handling
216216
The compression routines only handle characters that are in the list of valid
217217
characters. It is possible to compress every string that uses the valid
218218
character set. However, now all incoming strings are legal. For example the
219-
string "Y" is illegal because 'Y' is an escape character and the decoded expects
219+
string "Y" is illegal because "Y" is an escape character and the decoded expects
220220
another character to follow the escape character.
221221

222222
There are a few users that will use the compression routines: The

docs/proposals/InitializerInheritance.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ We can also distinguish two ways to originally invoke an initializer:
5050
Either kind of dispatched initialization poses a soundness problem
5151
because there may not be a sound initializer with any given signature
5252
in the most-derived class. In ObjC, initializers are normal instance
53-
methods and are therefore inherited like normal, but this isnt really
53+
methods and are therefore inherited like normal, but this isn't really
5454
quite right; initialization is different from a normal method in that
55-
its not inherently sensible to require subclasses to provide
55+
it's not inherently sensible to require subclasses to provide
5656
initializers at all the signatures that their superclasses provide.
5757

5858
Subobject initializers
5959
~~~~~~~~~~~~~~~~~~~~~~
6060
The defining class of a subobject initializer is central to its
6161
behavior. It can be soundly inherited by a class C only if is trivial
62-
to initialize the ivars of C, but its convenient to ignore that and
62+
to initialize the ivars of C, but it's convenient to ignore that and
6363
assume that subobjects will always trivially wrap and delegate to
6464
superclass subobject initializers.
6565

@@ -75,7 +75,7 @@ initializer of a class C if and only if it is defined by C.
7575

7676
Complete object initializers
7777
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78-
The defining class of a complete object initializer doesnt really
78+
The defining class of a complete object initializer doesn't really
7979
matter. In principle, complete object initializers could just as well
8080
be freestanding functions to which a metatype is passed. It can make
8181
sense to inherit a complete object initializer.
@@ -90,11 +90,11 @@ A complete object initializer soundly acts like a complete object
9090
initializer of a class C if and only if it delegates to an initializer
9191
which soundly acts like a complete object initializer of C.
9292

93-
These rules are not obvious to check statically because theyre
93+
These rules are not obvious to check statically because they're
9494
dependent on the dynamic value of the most-derived class C. Therefore
9595
any ability to check them depends on restricting C somehow relative to
9696
the defining class of the initializer. Since, statically, we only
97-
know the defining class of the initializer, we cant establish
97+
know the defining class of the initializer, we can't establish
9898
soundness solely at the definition site; instead we have to prevent
9999
unsound initializers from being called.
100100

@@ -116,7 +116,7 @@ Virtual initializers
116116
The above condition is not sufficient to make indirect initialization
117117
sound, because it relies on the ability to simply not use an
118118
initializer in cases where its delegation behavior isn't known to be
119-
sound, and we cant do that to arbitrary code. For that, we would
119+
sound, and we can't do that to arbitrary code. For that, we would
120120
need true virtual initializers.
121121

122122
A virtual initializer is a contract much more like that of a standard

docs/proposals/ValueSemantics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pseudo-random number generator). It needs to make one copy and do
175175
in-place mutation of the state, rather than wholesale value
176176
replacement via assignment, which might be expensive.
177177

178-
Heres a version of cycle_length that works when state is a mutable
178+
Here's a version of cycle_length that works when state is a mutable
179179
value type::
180180

181181
func cycle_length<State>(

include/swift/AST/Builtins.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ BUILTIN_SIL_OPERATION(FixLifetime, "fixLifetime", Special)
261261
///
262262
/// This builtin takes an inout object reference and returns a boolean. Passing
263263
/// the reference inout forces the optimizer to preserve a retain distinct from
264-
/// whats required to maintain lifetime for any of the reference's source-level
264+
/// what's required to maintain lifetime for any of the reference's source-level
265265
/// copies, because the called function is allowed to replace the reference,
266266
/// thereby releasing the referent.
267267
///

0 commit comments

Comments
 (0)