Skip to content

Commit 98b7597

Browse files
committed
add comments
1 parent 0ba04cc commit 98b7597

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/utils-get_code_dependency.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ move_functions_after_arrow <- function(ans, functions) {
344344
return(ans)
345345
}
346346
ans_pre <- ans[1:arrow_pos]
347+
# it's setdiff but without the removal of duplicates
348+
# do not use setdiff(ans_pre, functions)
349+
# as it removes duplicates from ans_pre even if they do not appear in functions
350+
# check setdiff(c("A", "A"), "B") - gives "A", where we want to keep c("A", "A")
347351
for (fun in functions) {
348352
if (any(ans_pre == fun)) ans_pre <- ans_pre[-match(fun, ans_pre)]
349353
}

0 commit comments

Comments
 (0)