From 4b4952b09ac198694d28167492a9a226d255eb64 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 1 Mar 2020 10:28:18 -0500 Subject: [PATCH] Add short-circuits for regex testing --- eeschema/sch_connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index 4b3c187463..0591b34f53 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -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 );