Skip to content

Commit

Permalink
reduce cyclocomp of fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alrosenstock committed Dec 11, 2023
1 parent 632acf4 commit 600370b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/get_source_expressions.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ get_source_expressions <- function(filename, lines = NULL) {
expressions[[i]]$xml_parsed_content <- expression_xmls[[i]]
expressions[[i]]$xml_find_function_calls <- build_xml_find_function_calls(expression_xmls[[i]])
}
} else {
# in R <= 4.0.5, this condition can occour
for (i in seq_along(expressions)) {
expressions[[i]]$xml_find_function_calls <- build_xml_find_function_calls(expressions[[i]]$xml_parsed_content)
}
}

# add global expression
Expand Down Expand Up @@ -487,6 +482,8 @@ get_single_source_expression <- function(loc,
lines = expr_lines,
parsed_content = pc,
xml_parsed_content = xml2::xml_missing(),
# Placeholder for xml_find_function_calls, if needed (e.g. on R <= 4.0.5 with input source "\\")
xml_find_function_calls = build_xml_find_function_calls(xml2::xml_missing()),
content = content
)
}
Expand Down

0 comments on commit 600370b

Please sign in to comment.