Skip to content

Commit 49e8a3f

Browse files
authored
Merge pull request #24 from luoxiu/return-early
return early if possible
2 parents 79e3baa + 99c2a1a commit 49e8a3f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

KakaJSON/Extension/Dictionary+KJ.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ extension Dictionary where Key == String {
9191
guard let index = Int(subKey),
9292
case array.indices = index else { return nil }
9393
value = array[index]
94+
} else {
95+
break
9496
}
9597
}
9698
return value

0 commit comments

Comments
 (0)