Explore method dispatch to avoid if(class(thing)) do (function) else do (other_function)
Open
low hanging fruit
refactor
- Dominant language
- C++
- Stars
- 607
- Forks
- 67
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 1
Description
e.g., Use method dispatch inside of `calculate` to avoid
```
if (is.greta_mcmc_list(values)) {
result <- calculate_greta_mcmc_list(
target = target,
values = values,
nsim = nsim,
tf_float = tf_float,
trace_batch_size = trace_batch_size
)
} else {
result <- calculate_list(
target = target,
values = values,
nsim = nsim,
tf_float = tf_float,
env = parent.frame()
)
}
```
Thanks @maelle for the suggestion
Contributor guide
Assessment
This issue has not been assessed yet.