Move the map lookup outside of the mesh processing loop. Change to unordered_map.

PiperOrigin-RevId: 651745837
Change-Id: Ibfcbe4b8cefa53a3dbaa99c4ca68442e2e10bc5d
This commit is contained in:
Nimrod Gileadi
2024-07-12 05:44:33 -07:00
committed by Copybara-Service
parent 6e64dd10e8
commit 84108589c4
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -20,6 +20,7 @@
#include <map>
#include <string>
#include <string_view>
#include <unordered_map>
#include <utility>
#include <vector>
@@ -276,7 +277,7 @@ class mjCModel : public mjCModel_, private mjSpec {
void RestoreState(const mjModel* m, mjData** dest);
// map from default class name to default class pointer
std::map<std::string, mjCDef*> def_map;
std::unordered_map<std::string, mjCDef*> def_map;
private:
// settings for each defaults class