1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

No need to compute layouts we’re not going to use.

This commit is contained in:
Rob Rix 2015-10-07 17:36:59 -04:00
parent 420dd640b8
commit f9de814a35

View File

@ -188,8 +188,8 @@ private enum Layout: CustomStringConvertible, Equatable {
}
}
static func better(width: Int, _ placed: Int, _ x: Layout, _ y: Layout) -> Layout {
return x.fits(width - placed) ? x : y
static func better(width: Int, _ placed: Int, _ x: Layout, @autoclosure _ y: () -> Layout) -> Layout {
return x.fits(width - placed) ? x : y()
}
}