diff --git a/.travis.yml b/.travis.yml
index 544690e..275f9c8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: objective-c
-osx_image: xcode9.3
+osx_image: xcode10.2
script:
- xcrun xcodebuild -project BTree.xcodeproj -scheme BTree-macOS test
- xcrun xcodebuild -project BTree.xcodeproj -scheme BTree-iOS
diff --git a/BTree.xcodeproj/project.pbxproj b/BTree.xcodeproj/project.pbxproj
index 9655c42..1371c16 100644
--- a/BTree.xcodeproj/project.pbxproj
+++ b/BTree.xcodeproj/project.pbxproj
@@ -573,7 +573,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
- LastUpgradeCheck = 0900;
+ LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Károly Lőrentey";
TargetAttributes = {
BB338C841DD27D2F00BB401D = {
@@ -582,11 +582,11 @@
};
BB54D0AE1C1F0357008A462B = {
CreatedOnToolsVersion = 7.2;
- LastSwiftMigration = 0900;
+ LastSwiftMigration = 1020;
};
BB54D0B81C1F0357008A462B = {
CreatedOnToolsVersion = 7.2;
- LastSwiftMigration = 0900;
+ LastSwiftMigration = 1020;
};
BB8FE9981C7C8CDC0051268F = {
CreatedOnToolsVersion = 7.2.1;
@@ -610,7 +610,7 @@
};
buildConfigurationList = BB54D0A91C1F0357008A462B /* Build configuration list for PBXProject "BTree" */;
compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
+ developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -907,7 +907,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
- SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -923,7 +922,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).PerformanceTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
- SWIFT_VERSION = 3.0;
};
name = Release;
};
@@ -939,7 +937,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).PerformanceTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
- SWIFT_VERSION = 3.0;
};
name = Profile;
};
@@ -955,7 +952,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).PerformanceTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
- SWIFT_VERSION = 3.0;
};
name = Unchecked;
};
@@ -964,6 +960,7 @@
baseConfigurationReference = BB8FE9931C7C8BB70051268F /* version.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -972,12 +969,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1006,7 +1005,6 @@
MTL_ENABLE_DEBUG_INFO = NO;
SWIFT_DISABLE_SAFETY_CHECKS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
- SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
@@ -1060,8 +1058,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).Tests.iOS";
PRODUCT_NAME = BTreeTests;
SDKROOT = iphoneos;
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.0;
};
name = Unchecked;
};
@@ -1084,6 +1080,7 @@
baseConfigurationReference = BB8FE9931C7C8BB70051268F /* version.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -1092,12 +1089,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1132,7 +1131,6 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "-DDebug $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "";
@@ -1146,6 +1144,7 @@
baseConfigurationReference = BB8FE9931C7C8BB70051268F /* version.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -1154,12 +1153,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1187,7 +1188,6 @@
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_SWIFT_FLAGS = "-DENABLE_BENCHMARK_TESTS $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
- SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
@@ -1239,8 +1239,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).Tests.iOS";
PRODUCT_NAME = BTreeTests;
SDKROOT = iphoneos;
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -1252,8 +1250,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).Tests.iOS";
PRODUCT_NAME = BTreeTests;
SDKROOT = iphoneos;
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -1520,6 +1516,7 @@
baseConfigurationReference = BB8FE9931C7C8BB70051268F /* version.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -1528,12 +1525,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1561,7 +1560,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
- SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
@@ -1615,8 +1613,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).Tests.iOS";
PRODUCT_NAME = BTreeTests;
SDKROOT = iphoneos;
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.0;
};
name = Profile;
};
diff --git a/BTree.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/BTree.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/BTree.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/BTree.xcodeproj/xcshareddata/xcschemes/BTree-PerformanceTests.xcscheme b/BTree.xcodeproj/xcshareddata/xcschemes/BTree-PerformanceTests.xcscheme
index 42706bd..45e81fc 100644
--- a/BTree.xcodeproj/xcshareddata/xcschemes/BTree-PerformanceTests.xcscheme
+++ b/BTree.xcodeproj/xcshareddata/xcschemes/BTree-PerformanceTests.xcscheme
@@ -1,6 +1,6 @@
+ codeCoverageEnabled = "YES"
+ shouldUseLaunchSchemeArgsEnv = "YES">
@@ -57,7 +56,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
diff --git a/BTree.xcodeproj/xcshareddata/xcschemes/BTree-tvOS.xcscheme b/BTree.xcodeproj/xcshareddata/xcschemes/BTree-tvOS.xcscheme
index bef4ad9..e010fd8 100644
--- a/BTree.xcodeproj/xcshareddata/xcschemes/BTree-tvOS.xcscheme
+++ b/BTree.xcodeproj/xcshareddata/xcschemes/BTree-tvOS.xcscheme
@@ -1,6 +1,6 @@
@@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
diff --git a/Package.swift b/Package.swift
index e8434f5..3e26971 100644
--- a/Package.swift
+++ b/Package.swift
@@ -20,5 +20,5 @@ let package = Package(
.target(name: "BTree", dependencies: [], path: "Sources"),
.testTarget(name: "BTreeTests", dependencies: ["BTree"], path: "Tests/BTreeTests")
],
- swiftLanguageVersions: [4]
+ swiftLanguageVersions: [5]
)
diff --git a/Sources/BTree.swift b/Sources/BTree.swift
index 18b0b05..e5a0718 100644
--- a/Sources/BTree.swift
+++ b/Sources/BTree.swift
@@ -289,14 +289,14 @@ public extension BTree {
/// Returns the first element in this tree, or `nil` if the tree is empty.
///
/// - Complexity: O(log(`count`))
- public var first: Element? {
+ var first: Element? {
return root.first
}
/// Returns the last element in this tree, or `nil` if the tree is empty.
///
/// - Complexity: O(log(`count`))
- public var last: Element? {
+ var last: Element? {
return root.last
}
@@ -304,7 +304,7 @@ public extension BTree {
///
/// - Requires: `offset >= 0 && offset < count`
/// - Complexity: O(log(`count`))
- public func element(atOffset offset: Int) -> Element {
+ func element(atOffset offset: Int) -> Element {
precondition(offset >= 0 && offset < count)
var offset = offset
var node = root
@@ -324,7 +324,7 @@ public extension BTree {
/// If there are multiple elements with the same key, `selector` indicates which matching element to find.
///
/// - Complexity: O(log(`count`))
- public func value(of key: Key, choosing selector: BTreeKeySelector = .any) -> Value? {
+ func value(of key: Key, choosing selector: BTreeKeySelector = .any) -> Value? {
switch selector {
case .any:
var node = root
@@ -362,7 +362,7 @@ public extension BTree {
/// This method never returns `endIndex`.
///
/// - Complexity: O(log(`count`))
- public func index(forKey key: Key, choosing selector: BTreeKeySelector = .any) -> Index? {
+ func index(forKey key: Key, choosing selector: BTreeKeySelector = .any) -> Index? {
let path = BTreeWeakPath(root: root, key: key, choosing: selector)
guard !path.isAtEnd && (selector == .after || path.key == key) else { return nil }
return Index(path)
@@ -374,7 +374,7 @@ public extension BTree {
/// The returned index may be `endIndex` if the tree is empty or `key` is greater than or equal to the key of the largest element.
///
/// - Complexity: O(log(`count`))
- public func index(forInserting key: Key, at selector: BTreeKeySelector = .any) -> Index {
+ func index(forInserting key: Key, at selector: BTreeKeySelector = .any) -> Index {
let path = BTreeWeakPath(root: root, key: key, choosing: selector == .last ? .after : selector)
return Index(path)
}
@@ -383,7 +383,7 @@ public extension BTree {
/// If there are multiple elements with the same key, `selector` indicates which matching element to find.
///
/// - Complexity: O(log(`count`))
- public func offset(forKey key: Key, choosing selector: BTreeKeySelector = .any) -> Int? {
+ func offset(forKey key: Key, choosing selector: BTreeKeySelector = .any) -> Int? {
var node = root
var offset = 0
var match: Int? = nil
@@ -410,7 +410,7 @@ public extension BTree {
/// Returns the offset of the element at `index`.
///
/// - Complexity: O(1)
- public func offset(of index: Index) -> Int {
+ func offset(of index: Index) -> Int {
index.state.expectRoot(root)
return index.state.offset
}
@@ -419,7 +419,7 @@ public extension BTree {
///
/// - Requires: `offset >= 0 && offset <= count`
/// - Complexity: O(log(`count`))
- public func index(ofOffset offset: Int) -> Index {
+ func index(ofOffset offset: Int) -> Index {
return Index(BTreeWeakPath(root: root, offset: offset))
}
}
diff --git a/Sources/BTreeMerger.swift b/Sources/BTreeMerger.swift
index 747551a..e6e9c18 100644
--- a/Sources/BTreeMerger.swift
+++ b/Sources/BTreeMerger.swift
@@ -687,7 +687,7 @@ internal extension BTreeStrongPath {
}
/// Move sideways `n` slots to the right, skipping over subtrees along the way.
- internal mutating func skipForward(_ n: Int) {
+ mutating func skipForward(_ n: Int) {
if !node.isLeaf {
for i in 0 ..< n {
let s = slot! + i
diff --git a/Sources/BTreeNode.swift b/Sources/BTreeNode.swift
index e01e395..17e6f86 100644
--- a/Sources/BTreeNode.swift
+++ b/Sources/BTreeNode.swift
@@ -56,7 +56,7 @@ internal final class BTreeNode {
self.children = children
self.count = count
self._depth = (children.count == 0 ? 0 : children[0]._depth + 1)
- assert(children.index { $0._depth + (1 as Int32) != self._depth } == nil)
+ assert(children.firstIndex { $0._depth + (1 as Int32) != self._depth } == nil)
}
}
diff --git a/Sources/List.swift b/Sources/List.swift
index 7151fc5..693c956 100644
--- a/Sources/List.swift
+++ b/Sources/List.swift
@@ -297,7 +297,7 @@ public extension List {
/// - Complexity: O(`count`)
///
/// [equivalence relation]: https://en.wikipedia.org/wiki/Equivalence_relation
- public func elementsEqual(_ other: List, by isEquivalent: (Element, Element) throws -> Bool) rethrows -> Bool {
+ func elementsEqual(_ other: List, by isEquivalent: (Element, Element) throws -> Bool) rethrows -> Bool {
return try self.tree.elementsEqual(other.tree, by: { try isEquivalent($0.1, $1.1) })
}
@@ -305,7 +305,7 @@ public extension List {
/// such value is not found.
///
/// - Complexity: O(`count`)
- public func index(where predicate: (Element) throws -> Bool) rethrows -> Index? {
+ func index(where predicate: (Element) throws -> Bool) rethrows -> Index? {
var i = 0
try self.tree.forEach { element -> Bool in
if try predicate(element.1) {
@@ -329,14 +329,14 @@ public extension List where Element: Equatable {
/// - Complexity: O(`count`)
///
/// [equivalence relation]: https://en.wikipedia.org/wiki/Equivalence_relation
- public func elementsEqual(_ other: List) -> Bool {
+ func elementsEqual(_ other: List) -> Bool {
return self.tree.elementsEqual(other.tree, by: { $0.1 == $1.1 })
}
/// Returns the first index where the given element appears in `self` or `nil` if the element is not found.
///
/// - Complexity: O(`count`)
- public func index(of element: Element) -> Index? {
+ func index(of element: Element) -> Index? {
var i = 0
self.tree.forEach { e -> Bool in
if element == e.1 {
@@ -349,7 +349,7 @@ public extension List where Element: Equatable {
}
/// Return true iff `element` is in `self`.
- public func contains(_ element: Element) -> Bool {
+ func contains(_ element: Element) -> Bool {
return index(of: element) != nil
}
@@ -359,12 +359,12 @@ public extension List where Element: Equatable {
/// two lists are divergent mutations originating from the same value.
///
/// - Complexity: O(`count`)
- public static func ==(a: List, b: List) -> Bool {
+ static func ==(a: List, b: List) -> Bool {
return a.elementsEqual(b)
}
/// Returns false iff the two lists do not have the same elements in the same order.
- public static func !=(a: List, b: List) -> Bool {
+ static func !=(a: List, b: List) -> Bool {
return !(a == b)
}
}
diff --git a/Sources/SortedBag.swift b/Sources/SortedBag.swift
index 5d72719..e2f6c7f 100644
--- a/Sources/SortedBag.swift
+++ b/Sources/SortedBag.swift
@@ -262,7 +262,7 @@ extension SortedBag {
/// Return an `Array` containing the non-`nil` results of mapping `transform` over `self`.
public func flatMap(_ transform: (Element) throws -> T?) rethrows -> [T] {
- return try tree.flatMap { try transform($0.0) }
+ return try tree.compactMap { try transform($0.0) }
}
/// Return an `Array` containing the elements of `self`, in ascending order, that satisfy the predicate `includeElement`.
diff --git a/Sources/SortedSet.swift b/Sources/SortedSet.swift
index 2145994..cc5e1ef 100644
--- a/Sources/SortedSet.swift
+++ b/Sources/SortedSet.swift
@@ -251,7 +251,7 @@ extension SortedSet {
/// Return an `Array` containing the non-`nil` results of mapping `transform` over `self`.
public func flatMap(_ transform: (Element) throws -> T?) rethrows -> [T] {
- return try tree.flatMap { try transform($0.0) }
+ return try tree.compactMap { try transform($0.0) }
}
/// Return an `Array` containing the elements of `self`, in ascending order, that satisfy the predicate `includeElement`.
diff --git a/Tests/BTreeTests/BTreeTestSupport.swift b/Tests/BTreeTests/BTreeTestSupport.swift
index aef3a0c..aac6de5 100644
--- a/Tests/BTreeTests/BTreeTestSupport.swift
+++ b/Tests/BTreeTests/BTreeTestSupport.swift
@@ -361,9 +361,10 @@ struct DictionaryBag: Collection {
struct Ref: Hashable {
let target: Target
- var hashValue: Int {
- return ObjectIdentifier(target).hashValue
+ func hash(into hasher: inout Hasher) {
+ hasher.combine(ObjectIdentifier(target))
}
+
static func ==(left: Ref, right: Ref) -> Bool {
return left.target === right.target
}
diff --git a/Tests/BTreeTests/String Manipulation.swift b/Tests/BTreeTests/String Manipulation.swift
index cc7a1c8..6943f0b 100644
--- a/Tests/BTreeTests/String Manipulation.swift
+++ b/Tests/BTreeTests/String Manipulation.swift
@@ -13,7 +13,7 @@ internal func layoutColumns(lines: [[String]], separator: String = " ") -> [St
let columnCount = lines.reduce(0) { a, l in max(a, l.count) }
var columnWidths = [Int](repeating: 0, count: columnCount)
lines.lazy.flatMap { $0.enumerated() }.forEach { i, c in
- columnWidths[i] = max(columnWidths[i], c.characters.count)
+ columnWidths[i] = max(columnWidths[i], c.count)
}
var result: [String] = []
@@ -25,7 +25,7 @@ internal func layoutColumns(lines: [[String]], separator: String = " ") -> [St
line += separator
}
line += c
- line += String(repeating: " ", count: columnWidths[i] - c.characters.count)
+ line += String(repeating: " ", count: columnWidths[i] - c.count)
}
result.append(line)
}
diff --git a/version.xcconfig b/version.xcconfig
index 10ce88a..5c12ce6 100644
--- a/version.xcconfig
+++ b/version.xcconfig
@@ -3,3 +3,4 @@ VERSION_STRING = 4.1.0
BUILD_NUMBER = 13
BUNDLE_IDENTIFIER_BASE = org.attaswift.$(PROJECT_NAME)
+SWIFT_VERSION = 5.0