mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
Prefer static const std::regex
std::regex has a relatively expensive constructor, and these are unchanging regexes.
This commit is contained in:
parent
44d93048b3
commit
1df482d51f
3 changed files with 11 additions and 8 deletions
|
@ -100,7 +100,9 @@ void BroadbandAdapterSettingsDialog::SaveAddress()
|
|||
switch (m_bba_type)
|
||||
{
|
||||
case Type::Ethernet:
|
||||
if (!std::regex_match(bba_new_address, std::regex("([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})")))
|
||||
{
|
||||
static const std::regex re_mac_address("([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})");
|
||||
if (!std::regex_match(bba_new_address, re_mac_address))
|
||||
{
|
||||
ModalMessageBox::critical(
|
||||
this, tr("Broadband Adapter Error"),
|
||||
|
@ -111,7 +113,7 @@ void BroadbandAdapterSettingsDialog::SaveAddress()
|
|||
}
|
||||
Config::SetBaseOrCurrent(Config::MAIN_BBA_MAC, bba_new_address);
|
||||
break;
|
||||
|
||||
}
|
||||
case Type::BuiltIn:
|
||||
Config::SetBaseOrCurrent(Config::MAIN_BBA_BUILTIN_DNS, bba_new_address);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue