linux-dist/evdev: Use std::Map.find() instead of operator[]

Since EvdevControllerMapping does not have a default constructor,
we can't use the operator[];

    data_type& operator[](const key_type& k) - Returns a reference to
    the object that is associated with a particular key. If the map
    does not already contain such an object, operator[] inserts the
    default object data_type().

Instead, we use the std::map.find() function.

This should resolve #971.
This commit is contained in:
Jan Holthuis 2016-09-23 12:54:27 +02:00
parent e5d8851316
commit b7fa676546
1 changed files with 1 additions and 1 deletions

View File

@ -285,7 +285,7 @@
return -3;
}
}
controller->mapping = &loaded_mappings[string(mapping_fname)];
controller->mapping = &loaded_mappings.find(string(mapping_fname))->second;
printf("evdev: Using '%s' mapping\n", controller->mapping->name);
controller->init();