Skip to content

Commit 598d2bd

Browse files
committed
slight refactor
1 parent 3a95b2b commit 598d2bd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/skimpy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ List mvp_deriv(
7171
const List &allnames, const List &allpowers, const NumericVector &coefficients,
7272
const CharacterVector &v // v a vector of symbols to be differentiated WR to.
7373
){
74-
75-
mvp X = prepare(allnames, allpowers, coefficients);
76-
mvp out = std::accumulate(v.begin(), v.end(), X,
77-
[](mvp acc, const auto& var) { return deriv(acc, std::string(var)); });
74+
mvp out = prepare(allnames, allpowers, coefficients);
75+
for (const auto &var : v) {
76+
out = deriv(out, std::string(var));
77+
}
7878
return retval(out);
7979
}
8080

0 commit comments

Comments
 (0)