Skip to content

Commit dc2b5ba

Browse files
committed
Update to Swift 3.0
1 parent bad00fe commit dc2b5ba

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: Shell Sort/Tests/Tests.xcodeproj/project.pbxproj

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
TargetAttributes = {
9292
7B2BBC7F1C779D720067B71D = {
9393
CreatedOnToolsVersion = 7.2;
94+
LastSwiftMigration = 0800;
9495
};
9596
};
9697
};
@@ -224,6 +225,7 @@
224225
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
225226
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
226227
PRODUCT_NAME = "$(TARGET_NAME)";
228+
SWIFT_VERSION = 3.0;
227229
};
228230
name = Debug;
229231
};
@@ -235,6 +237,7 @@
235237
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
236238
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
237239
PRODUCT_NAME = "$(TARGET_NAME)";
240+
SWIFT_VERSION = 3.0;
238241
};
239242
name = Release;
240243
};

Diff for: Shell Sort/shellsort.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
2222

23-
public func insertionSort(inout list: [Int], start: Int, gap: Int) {
24-
for i in (start + gap).stride(to: list.count, by: gap) {
23+
public func insertionSort(_ list: inout [Int], start: Int, gap: Int) {
24+
for i in stride(from: (start + gap), to: list.count, by: gap) {
2525
let currentValue = list[i]
2626
var pos = i
2727
while pos >= gap && list[pos - gap] > currentValue {
@@ -32,7 +32,7 @@ public func insertionSort(inout list: [Int], start: Int, gap: Int) {
3232
}
3333
}
3434

35-
public func shellSort(inout list: [Int]) {
35+
public func shellSort(_ list: inout [Int]) {
3636
var sublistCount = list.count / 2
3737
while sublistCount > 0 {
3838
for pos in 0..<sublistCount {

0 commit comments

Comments
 (0)