1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-11 13:15:35 +03:00

Simplify nesting with compound if-let

This commit is contained in:
Yuriy Kashnikov 2017-08-16 14:16:18 +07:00
parent 995dd5344d
commit b81e82372c

View File

@ -299,14 +299,10 @@ open class SVGParser {
var green = 0.0
var blue = 0.0
if (x.count == 3) {
if let r = Double(x[0]) {
if let r = Double(x[0]), let g = Double(x[1]), let b = Double(x[2]) {
blue = b
green = g
red = r
if let g = Double(x[1]) {
green = g
if let b = Double(x[2]) {
blue = b
}
}
}
}
if inPercentage {