Voltaire // Use Swift-specific iterators in certain context.
This commit is contained in:
parent
1ab378ebd2
commit
acfe46daef
|
@ -129,8 +129,8 @@ private class HorizontalCandidateView: NSView {
|
|||
)
|
||||
|
||||
var accuWidth: CGFloat = 0
|
||||
for index in 0..<elementWidths.count {
|
||||
let currentWidth = elementWidths[index]
|
||||
for (index, elementWidth) in elementWidths.enumerated() {
|
||||
let currentWidth = elementWidth
|
||||
let rctCandidateArea = NSRect(
|
||||
x: accuWidth, y: 0.0, width: currentWidth + 1.0,
|
||||
height: candidateTextHeight + cellPadding
|
||||
|
@ -203,8 +203,8 @@ private class HorizontalCandidateView: NSView {
|
|||
return nil
|
||||
}
|
||||
var accuWidth: CGFloat = 0.0
|
||||
for index in 0..<elementWidths.count {
|
||||
let currentWidth = elementWidths[index]
|
||||
for (index, elementWidth) in elementWidths.enumerated() {
|
||||
let currentWidth = elementWidth
|
||||
|
||||
if location.x >= accuWidth, location.x <= accuWidth + currentWidth {
|
||||
return UInt(index)
|
||||
|
|
|
@ -135,8 +135,8 @@ private class VerticalCandidateView: NSView {
|
|||
)
|
||||
|
||||
var accuHeight: CGFloat = 0
|
||||
for index in 0..<elementHeights.count {
|
||||
let currentHeight = elementHeights[index]
|
||||
for (index, elementHeight) in elementHeights.enumerated() {
|
||||
let currentHeight = elementHeight
|
||||
let rctCandidateArea = NSRect(
|
||||
x: 0.0, y: accuHeight, width: windowWidth, height: candidateTextHeight + cellPadding
|
||||
)
|
||||
|
@ -207,8 +207,8 @@ private class VerticalCandidateView: NSView {
|
|||
return nil
|
||||
}
|
||||
var accuHeight: CGFloat = 0.0
|
||||
for index in 0..<elementHeights.count {
|
||||
let currentHeight = elementHeights[index]
|
||||
for (index, elementHeight) in elementHeights.enumerated() {
|
||||
let currentHeight = elementHeight
|
||||
|
||||
if location.y >= accuHeight, location.y <= accuHeight + currentHeight {
|
||||
return UInt(index)
|
||||
|
|
Loading…
Reference in New Issue