Skip to content

Commit

Permalink
Minor code tweaks (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgallou authored Oct 22, 2024
1 parent 9698c08 commit 2b8249b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/checkers.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ is_bib <- function(x) {
}

is_updating_bib <- function(x) {
is_rendering() && names(x) == "bib"
is_rendering() && names(x) == "bib" && x != get("bib")
}

is_unit_set <- function(x) {
Expand Down Expand Up @@ -83,7 +83,7 @@ caller_arg <- function() {
deparse(substitute(x, env = parent.frame()))
}

check_type <- function(x, asserter, expected, arg = caller_arg()) {
check_type <- function(x, asserter, expected, arg) {
if (asserter(x)) {
return(invisible())
}
Expand Down
4 changes: 2 additions & 2 deletions R/pkrt-set.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ reset <- function(x) {
}

update <- function(x) {
do.call(set, as.list(x))
if (is_updating_bib(x)) {
bib_write()
bib_set()
withr::defer(bib_set())
}
do.call(set, as.list(x))
}

set_option <- function(x) {
Expand Down

0 comments on commit 2b8249b

Please sign in to comment.