Skip to content

Commit d5c32d6

Browse files
committed
cachematrix.R: Added {} after functions to improve readability
1 parent 4c40e26 commit d5c32d6

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

cachematrix.R

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,25 @@ makeCacheMatrix <- function(x = matrix()) {
1515
}
1616
## Modify existing matrix, and initially clean cache to empty
1717

18-
get <- function() x
18+
get <- function() {
1919
## Returns original matrix
20-
21-
setinverse <- function(solve) inverseX <<- solve
20+
21+
x
22+
}
23+
24+
setinverse <- function(solve) {
2225
## compute inverse matrix, assign to inverseX, and store it to cache
23-
24-
getinverse <- function() inverseX
26+
27+
inverseX <<- solve
28+
}
29+
30+
getinverse <- function() {
2531
## Returns matrix inverse
2632

27-
list(set = set, get = get,
28-
setinverse = setinverse,
29-
getinverse = getinverse)
33+
inverseX
34+
}
35+
36+
list(set = set, get = get, setinverse = setinverse, getinverse = getinverse)
3037
}
3138

3239

0 commit comments

Comments
 (0)