Skip to content

Commit dbf8f29

Browse files
Remove unused variables (#999)
These are assigned but never used.
1 parent 4398297 commit dbf8f29

File tree

4 files changed

+1
-11
lines changed

4 files changed

+1
-11
lines changed

R/indent.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ indent_without_paren_for_while_fun <- function(pd, indent_by) {
3434
indent_without_paren_if_else <- function(pd, indent_by) {
3535
expr_after_if <- next_non_comment(pd, which(pd$token == "')'")[1])
3636
is_if <- pd$token[1] %in% "IF"
37-
has_if_without_curly <-
38-
is_if && pd$child[[expr_after_if]]$token[1] != "'{'"
3937
if (!is_if) {
4038
return(pd)
4139
}
@@ -47,8 +45,6 @@ indent_without_paren_if_else <- function(pd, indent_by) {
4745
pd$indent[expr_after_if] <- indent_by
4846
}
4947

50-
51-
5248
else_idx <- which(pd$token == "ELSE")
5349
if (length(else_idx) == 0L) {
5450
return(pd)

R/reindent.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ apply_ref_indention <- function(flattened_pd) {
3030
#' @keywords internal
3131
apply_ref_indention_one <- function(flattened_pd, target_token) {
3232
token_to_update <- find_tokens_to_update(flattened_pd, target_token)
33-
# udate spaces
33+
# update spaces
3434
copied_spaces <- flattened_pd$col2[target_token]
35-
old_spaces <- flattened_pd$lag_spaces[token_to_update[1]]
3635
shift <- copied_spaces
3736
flattened_pd$lag_spaces[token_to_update] <-
3837
flattened_pd$lag_spaces[token_to_update] + shift

R/rules-line-breaks.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ set_line_break_before_curly_opening <- function(pd) {
114114
next_non_comment,
115115
pd = pd
116116
)
117-
non_comment_after_expr <- non_comment_after_comma[
118-
non_comment_after_comma > should_not_be_on_same_line_idx[1]
119-
]
120117
pd$lag_newlines[non_comment_after_comma] <- 1L
121118
}
122119
}
@@ -312,7 +309,6 @@ set_line_break_after_opening_if_call_is_multi_line <- function(pd,
312309
}
313310
break_pos <- find_line_break_position_in_multiline_call(pd)
314311
idx_nested <- next_non_comment(pd, 2)
315-
nested_call <- is_function_call(pd$child[[idx_nested]])
316312
if (pd_is_multi_line(pd$child[[idx_nested]]) && sum(pd$lag_newlines) > 0L) {
317313
break_pos <- c(break_pos, idx_nested)
318314
}

R/stylerignore.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ add_stylerignore <- function(pd_flat) {
6262
if (!env_current$any_stylerignore) {
6363
return(pd_flat)
6464
}
65-
pd_flat_terminals <- pd_flat[pd_flat$terminal, ]
6665
pd_flat_lat_line1 <- lag(pd_flat$line2, default = 0)
6766
on_same_line <- pd_flat$line1 == pd_flat_lat_line1
6867
cumsum_start <- cumsum(start_candidate & !on_same_line)

0 commit comments

Comments
 (0)