Skip to content

Commit cb4618a

Browse files
Clean up redundant getOption (#606)
1 parent d8d33b4 commit cb4618a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

R/covr.R

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -415,20 +415,16 @@ package_coverage <- function(path = ".",
415415
install_path <- normalize_path(install_path)
416416
dir.create(install_path)
417417

418-
flags <- getOption("covr.flags")
419-
420418
# check for compiler
421419
if (!uses_icc()) {
422420
flags <- getOption("covr.flags")
421+
} else if (length(getOption("covr.icov")) > 0L) {
422+
flags <- getOption("covr.icov_flags")
423+
# clean up old icov files
424+
unlink(file.path(pkg$path, "src", "*.dyn"))
425+
unlink(file.path(pkg$path, "src", "pgopti.*"))
423426
} else {
424-
if (length(getOption("covr.icov")) > 0L) {
425-
flags <- getOption("covr.icov_flags")
426-
# clean up old icov files
427-
unlink(file.path(pkg$path, "src","*.dyn"))
428-
unlink(file.path(pkg$path, "src","pgopti.*"))
429-
} else {
430-
stop("icc is not available")
431-
}
427+
stop("icc is not available")
432428
}
433429

434430
if (isTRUE(clean)) {

0 commit comments

Comments
 (0)