Skip to content

Commit 5fe2523

Browse files
committed
Changed indentation from 2 to 4 spaces.
1 parent 83aa306 commit 5fe2523

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

cachematrix.R

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@
77
# write guard clause against x != matrix
88
# fix indentation to 4
99
makeCacheMatrix <- function(x = matrix()) {
10-
inverse <- NULL
11-
set <- function(y) {
12-
x <<- y
13-
inverse <<- NULL
14-
}
15-
get <- function() x
16-
setInverse <- function(inverseMatrix) inverse <<- inverseMatrix
17-
getInverse <- function() inverse
18-
list(set = set, get = get,
19-
setInverse = setInverse,
20-
getInverse = getInverse)
10+
inverse <- NULL
11+
set <- function(y) {
12+
x <<- y
13+
inverse <<- NULL
14+
}
15+
get <- function() x
16+
setInverse <- function(inverseMatrix) inverse <<- inverseMatrix
17+
getInverse <- function() inverse
18+
list(set = set, get = get,
19+
setInverse = setInverse,
20+
getInverse = getInverse)
2121
}
2222

2323

2424
## Write a short comment describing this function
2525

2626
cacheSolve <- function(x, ...) {
27-
## Return a matrix that is the inverse of 'x'
28-
29-
inverse <- x$getInverse()
30-
if(!is.null(inverse)) {
31-
message("getting cached inverse matrix")
27+
## Return a matrix that is the inverse of 'x'
28+
29+
inverse <- x$getInverse()
30+
if(!is.null(inverse)) {
31+
message("getting cached inverse matrix")
3232
return(inverse)
33-
}
34-
35-
data <- x$get()
36-
inverse <- solve(data, ...)
37-
x$setInverse(inverse)
38-
inverse
33+
}
34+
35+
data <- x$get()
36+
inverse <- solve(data, ...)
37+
x$setInverse(inverse)
38+
inverse
3939
}

0 commit comments

Comments
 (0)