File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -407,8 +407,9 @@ class OpSchemaRegistry {
407
407
static OpSchema&
408
408
NewSchema (const string& key, const string& file, const int line) {
409
409
auto & m = map ();
410
- if (m.count (key)) {
411
- const auto & schema = m[key];
410
+ auto it = m.find (key);
411
+ if (it != m.end ()) {
412
+ const auto & schema = it->second ;
412
413
std::ios_base::Init init;
413
414
std::cerr << " Trying to register schema with name " << key
414
415
<< " from file " << file << " line " << line
@@ -422,8 +423,9 @@ class OpSchemaRegistry {
422
423
423
424
static const OpSchema* Schema (const string& key) {
424
425
auto & m = map ();
425
- if (m.count (key)) {
426
- return &m[key];
426
+ auto it = m.find (key);
427
+ if (it != m.end ()) {
428
+ return &it->second ;
427
429
} else {
428
430
return nullptr ;
429
431
}
You can’t perform that action at this time.
0 commit comments