Use wxString's empty() when checking if the string is (non-)empty throughout wx.
Instead of constructs such as if "( s.length() )" and "if (s.length() > 0)" use "if ( !s.empty() )" instead. Similarly for "if (s.length() == 0)" or "if ( s.IsNull() )", use "if ( s.empty() )". No code changes intended except for a few instances where a construct like "if ( s.length() && wxFileExists(s) )" was changed to not check the length of the string and let wxFileExists handle such cases. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -395,7 +395,7 @@ void wxDialUpManagerImpl::DisableAutoCheckOnlineStatus()
|
||||
|
||||
void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno)
|
||||
{
|
||||
if(hostname.length() == 0)
|
||||
if( hostname.empty() )
|
||||
{
|
||||
m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST;
|
||||
m_BeaconPort = 80;
|
||||
@@ -404,7 +404,7 @@ void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno)
|
||||
|
||||
// does hostname contain a port number?
|
||||
wxString port = hostname.After(wxT(':'));
|
||||
if(port.length())
|
||||
if( !port.empty() )
|
||||
{
|
||||
m_BeaconHost = hostname.Before(wxT(':'));
|
||||
m_BeaconPort = wxAtoi(port);
|
||||
@@ -667,7 +667,7 @@ wxDialUpManagerImpl::CheckIfconfig()
|
||||
{
|
||||
wxLogNull ln; // suppress all error messages
|
||||
|
||||
wxASSERT_MSG( m_IfconfigPath.length(),
|
||||
wxASSERT_MSG( !m_IfconfigPath.empty(),
|
||||
wxT("can't use ifconfig if it wasn't found") );
|
||||
|
||||
wxString tmpfile = wxFileName::CreateTempFileName( wxT("_wxdialuptest") );
|
||||
|
Reference in New Issue
Block a user