Skip to content

Commit 1e026d7

Browse files
authored
Merge pull request kodecocodes#603 from remlostime/single-source-path-swift
[Swift 4] Update Single-Source Shortest Paths (Weighted)
2 parents edda1ea + 23ff396 commit 1e026d7

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

Diff for: Graph/Graph.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
ONLY_ACTIVE_ARCH = YES;
290290
SDKROOT = macosx;
291291
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
292+
SWIFT_VERSION = 4.0;
292293
VERSIONING_SYSTEM = "apple-generic";
293294
VERSION_INFO_PREFIX = "";
294295
};
@@ -338,6 +339,7 @@
338339
MTL_ENABLE_DEBUG_INFO = NO;
339340
SDKROOT = macosx;
340341
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
342+
SWIFT_VERSION = 4.0;
341343
VERSIONING_SYSTEM = "apple-generic";
342344
VERSION_INFO_PREFIX = "";
343345
};

Diff for: Single-Source Shortest Paths (Weighted)/SSSP.playground/Contents.swift

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import Graph
22
import SSSP
33

4+
// last checked with Xcode 9.0b4
5+
#if swift(>=4.0)
6+
print("Hello, Swift 4!")
7+
#endif
8+
49
let graph = AdjacencyMatrixGraph<String>()
510
let s = graph.createVertex("s")
611
let t = graph.createVertex("t")

Diff for: Single-Source Shortest Paths (Weighted)/SSSP.xcodeproj/project.pbxproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
ONLY_ACTIVE_ARCH = YES;
335335
SDKROOT = macosx;
336336
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
337-
SWIFT_VERSION = 3.0;
337+
SWIFT_VERSION = 4.0;
338338
VERSIONING_SYSTEM = "apple-generic";
339339
VERSION_INFO_PREFIX = "";
340340
};
@@ -378,7 +378,7 @@
378378
MTL_ENABLE_DEBUG_INFO = NO;
379379
SDKROOT = macosx;
380380
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
381-
SWIFT_VERSION = 3.0;
381+
SWIFT_VERSION = 4.0;
382382
VERSIONING_SYSTEM = "apple-generic";
383383
VERSION_INFO_PREFIX = "";
384384
};
@@ -401,7 +401,7 @@
401401
PRODUCT_NAME = "$(TARGET_NAME)";
402402
SKIP_INSTALL = YES;
403403
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
404-
SWIFT_VERSION = 3.0;
404+
SWIFT_VERSION = 4.0;
405405
};
406406
name = Debug;
407407
};
@@ -421,7 +421,7 @@
421421
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-algorithm-club.SSSP";
422422
PRODUCT_NAME = "$(TARGET_NAME)";
423423
SKIP_INSTALL = YES;
424-
SWIFT_VERSION = 3.0;
424+
SWIFT_VERSION = 4.0;
425425
};
426426
name = Release;
427427
};
@@ -433,7 +433,7 @@
433433
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
434434
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-algorithm-club.SSSPTests";
435435
PRODUCT_NAME = "$(TARGET_NAME)";
436-
SWIFT_VERSION = 3.0;
436+
SWIFT_VERSION = 4.0;
437437
};
438438
name = Debug;
439439
};
@@ -445,7 +445,7 @@
445445
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
446446
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-algorithm-club.SSSPTests";
447447
PRODUCT_NAME = "$(TARGET_NAME)";
448-
SWIFT_VERSION = 3.0;
448+
SWIFT_VERSION = 4.0;
449449
};
450450
name = Release;
451451
};

Diff for: Single-Source Shortest Paths (Weighted)/SSSPTests/SSSPTests.swift

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import XCTest
1010
@testable import SSSP
1111

1212
class SSSPTests: XCTestCase {
13+
14+
func testSwift4() {
15+
// last checked with Xcode 9.0b4
16+
#if swift(>=4.0)
17+
print("Hello, Swift 4!")
18+
#endif
19+
}
1320

1421
/**
1522
See Figure 24.4 of “Introduction to Algorithms” by Cormen et al, 3rd ed., pg 652

0 commit comments

Comments
 (0)