2 ms·
Why can that not be swapped to: guard let array = obj.someArray, 0 < array.count else { throw SomeError } ?
by deathanatos 8y ago
Why can that not be swapped to:
guard let array = obj.someArray,
0 < array.count else {
throw SomeError
}
?
- zapzupnz 8y agoIt could be changed to that, but what am I really asking? "Is zero lower than the length of my array" is a bizarre way to word the question, as opposed to "is the length of my array greater than zero". I believe in self-documenting and obvious code, and I think if statements should read as much like a human sentence as possible.