Skip to content

Commit 4ec96be

Browse files
committed
perf: avoid c.Date when possible
Revert earlier change to try to reduce time inside `time_minus_time_in_n_steps`, as `c.Date` is more costly. This also works back towards generality from the previous `vec_c` -> `c` change.
1 parent db2f274 commit 4ec96be

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

R/epi_slide_opt_edf.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,9 @@ epi_slide_opt_one_epikey <- function(inp_tbl,
230230
out_filter_time_style,
231231
range = vec_rep_each(
232232
c(FALSE, TRUE, FALSE),
233-
time_minus_time_in_n_steps(
234-
c(out_t_min, out_t_max, slide_t_max),
235-
c(slide_t_min, out_t_min, out_t_max),
236-
time_type
237-
) + c(0L, 1L, 0L)
233+
c(time_minus_time_in_n_steps(out_t_min, slide_t_min, time_type),
234+
time_minus_time_in_n_steps(out_t_max, out_t_min, time_type) + 1L,
235+
time_minus_time_in_n_steps(slide_t_max, out_t_max, time_type))
238236
),
239237
set = vec_in(slide_time_values, out_time_values)
240238
)

0 commit comments

Comments
 (0)