Skip to content

Commit 5afdd96

Browse files
committed
better naming convention
1 parent 6667688 commit 5afdd96

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cachematrix.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ makeCacheMatrix <- function(x = matrix()) {
1010
m <<- NULL
1111
}
1212
get <- function() x
13-
setsolve <- function(solve) m <<- solve
14-
getsolve <- function() m
13+
setinverse <- function(solve) m <<- solve
14+
getinverse <- function() m
1515
list(set = set, get = get,
16-
setsolve = setsolve,
17-
getsolve = getsolve)
16+
setinverse = setinverse,
17+
getinverse = getinverse)
1818
}
1919

2020

2121
# This function computes the inverse of a matrix. If it's already been
2222
# calculated, then the function will retrieve the cached inverse.
2323
cacheSolve <- function(x, ...) {
24-
m <- x$getsolve()
24+
m <- x$getinverse()
2525
if(!is.null(m)) {
2626
message("getting cached data")
2727
return(m)
2828
}
2929
data <- x$get()
3030
m <- solve(data, ...)
31-
x$setsolve(m)
31+
x$setinverse(m)
3232
m
3333
}

0 commit comments

Comments
 (0)