From adad1ecff8495e1b90ab0b58d36a796b26c3d55f Mon Sep 17 00:00:00 2001 From: Paul Zabelin Date: Thu, 4 Jan 2018 07:37:02 -0800 Subject: [PATCH] cleanup self. --- Example/Tests/PerformanceTest.swift | 2 +- Pod/Classes/Matrix3x3+3D.swift | 2 +- Pod/Classes/Perspective.swift | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Example/Tests/PerformanceTest.swift b/Example/Tests/PerformanceTest.swift index 2000ece..828bf87 100644 --- a/Example/Tests/PerformanceTest.swift +++ b/Example/Tests/PerformanceTest.swift @@ -20,7 +20,7 @@ class PerformanceTest: XCTestCase { ) ) - self.measure { + measure { stride(from:0, to: 100000, by: 1).forEach { _ in _ = start.projectiveTransform(destination: destination) } diff --git a/Pod/Classes/Matrix3x3+3D.swift b/Pod/Classes/Matrix3x3+3D.swift index 7cde85d..29e3df5 100644 --- a/Pod/Classes/Matrix3x3+3D.swift +++ b/Pod/Classes/Matrix3x3+3D.swift @@ -38,7 +38,7 @@ extension Matrix3x3Type { func homogeneousInverse() -> Matrix3x3Type { #if arch(arm64) || arch(x86_64) - let result = self.inverse + let result = inverse #else let result = adjugate() #endif diff --git a/Pod/Classes/Perspective.swift b/Pod/Classes/Perspective.swift index 911fd9a..c0862e9 100644 --- a/Pod/Classes/Perspective.swift +++ b/Pod/Classes/Perspective.swift @@ -17,21 +17,21 @@ public final class Perspective { lazy var basisVectorsToPointsMap: Matrix3x3Type! = { let m = Matrix3x3Type([ - self.vectors[0], - self.vectors[1], - self.vectors[2]] + vectors[0], + vectors[1], + vectors[2]] ) - let solution = m.homogeneousInverse() * self.vectors[3] + let solution = m.homogeneousInverse() * vectors[3] let scale = Matrix3x3Type(diagonal: solution) let basisToPoints = m * scale return basisToPoints.zNormalized() }() lazy var pointsToBasisVectorsMap: Matrix3x3Type! = { - self.basisVectorsToPointsMap.homogeneousInverse() + basisVectorsToPointsMap.homogeneousInverse() }() internal func projection(to:Perspective) -> Matrix3x3Type { return (to.basisVectorsToPointsMap * pointsToBasisVectorsMap).zNormalized() } -} \ No newline at end of file +}