Skip to content

Commit

Permalink
guard lets on separate lines
Browse files Browse the repository at this point in the history
  • Loading branch information
paescebu committed Apr 26, 2022
1 parent a7ec83f commit dfd263f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/PolynomialRegressionSwift/PolynomialRegression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import Accelerate

public class PolynomialRegression {
public static func regression(withPoints points: [CGPoint], degree: Int) -> [Double]? {
guard degree > 0 else { return nil }
guard points.count > 1 else { return nil }
guard degree > 0 else {
return nil
}
guard points.count > 1 else {
return nil
}

let A = createAMatrix(basedOnDegree: degree, columns: degree, withPoints: points)
let b = createBVector(basedOnDegree: degree, withPoints: points)
Expand Down

0 comments on commit dfd263f

Please sign in to comment.