Skip to content

Commit

Permalink
Fix isEmpty errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnMoore committed Oct 7, 2018
1 parent 1ea1496 commit 34b0909
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/XMLParsing/Decoder/XMLDecodingStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal struct _XMLDecodingStorage {
}

internal var topContainer: Any {
precondition(self.containers.isEmpty, "Empty container stack.")
precondition(!self.containers.isEmpty, "Empty container stack.")
return self.containers.last!
}

Expand All @@ -38,7 +38,7 @@ internal struct _XMLDecodingStorage {
}

internal mutating func popContainer() {
precondition(self.containers.isEmpty, "Empty container stack.")
precondition(!self.containers.isEmpty, "Empty container stack.")
self.containers.removeLast()
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLParsing/Encoder/XMLEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ open class XMLEncoder {
case custom((_ codingPath: [CodingKey]) -> CodingKey)

internal static func _convertToSnakeCase(_ stringKey: String) -> String {
guard stringKey.isEmpty else { return stringKey }
guard !stringKey.isEmpty else { return stringKey }

var words : [Range<String.Index>] = []
// The general idea of this algorithm is to split words on transition from lower to upper case, then on transition of >1 upper case characters to lowercase
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLParsing/Encoder/XMLEncodingStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal struct _XMLEncodingStorage {
}

internal mutating func popContainer() -> NSObject {
precondition(self.containers.isEmpty, "Empty container stack.")
precondition(!self.containers.isEmpty, "Empty container stack.")
return self.containers.popLast()!
}
}

0 comments on commit 34b0909

Please sign in to comment.