Skip to content

Commit

Permalink
it may be more readable without using a closure from local()
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 13, 2024
1 parent 73370df commit 9c7308a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions R/as_rtf.R
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,12 @@ as_rtf.gs_design <- function(
# Add footnotes ----
# initialization for footnote
footnotes <- NULL
# footnote markers (a, b, c, ...)
marker <- local({
i <- 0L
function() {
i <<- i + 1L
letters[i]
}
})
# footnote markers (a, b, c, ... from letters[idx])
idx <- 0L
marker <- function() {
idx <<- idx + 1L
letters[idx]
}

for (i in seq_along(footnote$content)) {
att <- footnote$attr[i]
Expand Down

0 comments on commit 9c7308a

Please sign in to comment.