aboutsummaryrefslogtreecommitdiff
path: root/Sources/WmapParser/DependencyParser.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sources/WmapParser/DependencyParser.swift')
-rw-r--r--Sources/WmapParser/DependencyParser.swift8
1 files changed, 3 insertions, 5 deletions
diff --git a/Sources/WmapParser/DependencyParser.swift b/Sources/WmapParser/DependencyParser.swift
index 2567bfe..45408d5 100644
--- a/Sources/WmapParser/DependencyParser.swift
+++ b/Sources/WmapParser/DependencyParser.swift
@@ -22,9 +22,7 @@ extension WmapParser {
)
-> Dependency?
where T.Element == UInt8, T.Index == Int {
- guard let isDirected = extractIsDirected(bytes, separatorIndex, end) else {
- return nil
- }
+ let isDirected = extractIsDirected(bytes, separatorIndex, end)
guard let fromComponent = extractTrimmedString(bytes, start, separatorIndex) else {
return nil
@@ -45,10 +43,10 @@ extension WmapParser {
private static func extractIsDirected<T: Collection>(
_ bytes: T, _ separatorIndex: Int, _ end: Int
)
- -> Bool?
+ -> Bool
where T.Element == UInt8, T.Index == Int {
let followingCharacter = separatorIndex + 1
- guard followingCharacter < end else { return nil }
+ guard followingCharacter < end else { return false }
if bytes[followingCharacter] == kGreaterThan {
return true
}