15
15
#include < fstream>
16
16
#include < iostream>
17
17
#include < map>
18
+ #include < unordered_map>
18
19
19
20
using namespace std ;
20
21
@@ -32,8 +33,8 @@ const string ONE_SPACE(" ");
32
33
const string TWO_SPACES (" " );
33
34
34
35
// typedefs
35
- typedef map <string, string> vendors_map_t ;
36
- typedef map <string, map <string, string>> devices_map_t ;
36
+ typedef unordered_map <string, string> vendors_map_t ;
37
+ typedef unordered_map <string, unordered_map <string, string>> devices_map_t ;
37
38
38
39
// function prototypess
39
40
void print_usage (char * progname);
@@ -77,8 +78,8 @@ int main(int argc, char** argv)
77
78
return EXIT_FAILURE;
78
79
}
79
80
80
- map<string, string> vendors_map;
81
- map<string, map<string, string>> devices_map;
81
+ vendors_map_t vendors_map;
82
+ devices_map_t devices_map;
82
83
83
84
int print_all = 0 ;
84
85
int print_numbers = 0 ;
@@ -270,7 +271,7 @@ void parse_ids(string const& ids_file, vendors_map_t& vendors_map, devices_map_t
270
271
vendor_name = line.substr (line.find (TWO_SPACES) + TWO_SPACES.length ());
271
272
272
273
vendors_map[vendor_id] = vendor_name;
273
- devices_map[vendor_id] = map <string, string>();
274
+ devices_map[vendor_id] = unordered_map <string, string>();
274
275
}
275
276
}
276
277
}
0 commit comments