mirror of
https://github.com/rui314/mold.git
synced 2024-09-21 18:08:01 +03:00
Optimize regexes
This commit is contained in:
parent
6ae115ac69
commit
057fffb1dd
@ -1176,7 +1176,8 @@ void ObjectFile<E>::write_symtab(Context<E> &ctx) {
|
||||
}
|
||||
|
||||
bool is_c_identifier(std::string_view name) {
|
||||
static std::regex re("[a-zA-Z_][a-zA-Z0-9_]*");
|
||||
static std::regex re("[a-zA-Z_][a-zA-Z0-9_]*",
|
||||
std::regex_constants::optimize);
|
||||
return std::regex_match(name.begin(), name.end(), re);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ void sort_init_fini(Context<E> &ctx) {
|
||||
Timer t(ctx, "sort_init_fini");
|
||||
|
||||
auto get_priority = [](InputSection<E> *isec) {
|
||||
static std::regex re(R"(_array\.(\d+)$)");
|
||||
static std::regex re(R"(_array\.(\d+)$)", std::regex_constants::optimize);
|
||||
std::string name = isec->name().begin();
|
||||
std::smatch m;
|
||||
if (std::regex_search(name, m, re))
|
||||
|
Loading…
Reference in New Issue
Block a user