This commit changes the index following routines from a recursive functions to iterative ones. The code is slightly longer, but a loop is probably the most efficient way of doing this.
Also did some testing of the lint wrt to function definitions, and it is pretty crazy. It won't give any warnings if it runs the tests while the package is installed, and progressively finds more functions if, for example, change some of the problem ones to be nested. There are some issues raised in the repo about this, so probably need to ignore that part of the lint output. devtools::check passes without warnings. I haven't addresses the curly bracket issues in this PR. I'll add a followup to this one with those issues corrected as far as lint is concerned, but expect you will want to ignore it, as it won't match the rest of the package style.
I've now added a second commit that places opening curly brackets according to lintr::lint recommendations. Personal taste as to whether you want to keep those changes.
This commit changes the index following routines from a recursive functions to iterative ones. The code is slightly longer, but a loop is probably the most efficient way of doing this.
Also did some testing of the lint wrt to function definitions, and it is pretty crazy. It won't give any warnings if it runs the tests while the package is installed, and progressively finds more functions if, for example, change some of the problem ones to be nested. There are some issues raised in the repo about this, so probably need to ignore that part of the lint output. devtools::check passes without warnings. I haven't addresses the curly bracket issues in this PR. I'll add a followup to this one with those issues corrected as far as lint is concerned, but expect you will want to ignore it, as it won't match the rest of the package style.