Use a std::unordered_map for looking up sections by name (#1357)

This commit is contained in:
Sylvie
2024-03-13 19:45:52 -04:00
committed by GitHub
parent 8ec0d01fc4
commit eb99fc8681
3 changed files with 13 additions and 14 deletions

View File

@@ -5,6 +5,8 @@
#include <deque>
#include <stdint.h>
#include <string>
#include <unordered_map>
#include <vector>
#include "linkdefs.hpp"
@@ -49,6 +51,7 @@ struct SectionSpec {
};
extern std::deque<Section> sectionList;
extern std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`
extern Section *currentSection;
Section *sect_FindSectionByName(char const *name);