Add short-circuits for regex testing
This commit is contained in:
parent
cf15a1c493
commit
4b4952b09a
|
@ -408,6 +408,9 @@ bool SCH_CONNECTION::IsBusLabel( const wxString& aLabel )
|
|||
|
||||
bool SCH_CONNECTION::IsBusVectorLabel( const wxString& aLabel )
|
||||
{
|
||||
if( !aLabel.Contains( wxT( "[" ) ) )
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
return std::regex_match( std::string( aLabel.mb_str() ), bus_label_re );
|
||||
|
@ -421,6 +424,9 @@ bool SCH_CONNECTION::IsBusVectorLabel( const wxString& aLabel )
|
|||
|
||||
bool SCH_CONNECTION::IsBusGroupLabel( const wxString& aLabel )
|
||||
{
|
||||
if( !aLabel.Contains( wxT( "{" ) ) )
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
return std::regex_match( std::string( aLabel.mb_str() ), bus_group_label_re );
|
||||
|
|
Loading…
Reference in New Issue