Skip to content

Commit

Permalink
Remove nested if
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Apr 4, 2023
1 parent 2906dc3 commit de657ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/model-module-helpers.R
Expand Up @@ -132,10 +132,8 @@ convolution_matrix <- function(dist, t, include_partial = FALSE) {
l <- min(t - s + 1, ldist[s])
conv[s:(s + l - 1), s] <- head(dist[[s]], l)
}
if (!include_partial) {
if (ldist[1] > 1) {
conv[1:(ldist[1] - 1), ] <- 0
}
if (!include_partial && ldist[1] > 1) {
conv[1:(ldist[1] - 1), ] <- 0
}
return(conv)
}
Expand Down

0 comments on commit de657ed

Please sign in to comment.