Skip to content

Commit 16fea87

Browse files
committed
improve remove_dt_assign
1 parent 44f40a2 commit 16fea87

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

R/utils-get_code_dependency.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,7 @@ fix_shifted_comments <- function(calls) {
151151
remove_dt_assign <- function(calls) {
152152
checkmate::assert_list(calls)
153153
lapply(calls, function(call) {
154-
dt_assign <-
155-
which(call$token == "LEFT_ASSIGN" & call$text == ":=")
156-
if (length(dt_assign) > 0) {
157-
call[-dt_assign, ]
158-
} else {
159-
call
160-
}
154+
call <- subset(call, !(token == "LEFT_ASSIGN" & text == ":="))
161155
})
162156
}
163157

0 commit comments

Comments
 (0)