Skip to content

Commit 8314cee

Browse files
committed
XMLParser: Simplify the code in func _handleParseResult() -> Bool.
1 parent 2fe37a2 commit 8314cee

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Foundation/XMLParser.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,18 +465,14 @@ open class XMLParser : NSObject {
465465
}
466466

467467
internal func _handleParseResult(_ parseResult: Int32) -> Bool {
468-
var result = true
469-
if parseResult != 0 {
470-
if parseResult != -1 {
471-
// TODO: determine if this result is a fatal error from libxml via the CF implementations
472-
}
473-
468+
if parseResult == 0 {
469+
return true
470+
} else {
474471
if _parserError == nil {
475472
_parserError = NSError(domain: XMLParser.errorDomain, code: Int(parseResult))
476473
}
477-
result = false
478474
}
479-
return result
475+
return false
480476
}
481477

482478
internal func parseData(_ data: Data) -> Bool {

0 commit comments

Comments
 (0)