fix creation of std::vector

This commit is contained in:
Levi Burner
2024-11-26 16:42:08 -05:00
parent 5ba4d58497
commit 41b325785a
+1 -2
View File
@@ -198,8 +198,7 @@ PYBIND11_MODULE(_rollout, pymodule) {
) {
// get raw pointers
int nroll = state0.shape(0);
std::vector<const raw::MjModel*> model_ptrs;
model_ptrs.reserve(nroll);
std::vector<const raw::MjModel*> model_ptrs(nroll);
for (int r = 0; r < nroll; r++) {
model_ptrs[r] = m[r].cast<const MjModelWrapper*>()->get();
}