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:
Dimitri Schoolwerth
2011-01-22 14:38:36 +00:00
parent c9ed413ab4
commit 6636ef8ddf
47 changed files with 122 additions and 122 deletions

View File

@@ -225,7 +225,7 @@ bool wxHTTP::ParseHeaders()
if (m_lastError != wxPROTO_NOERR)
return false;
if (line.length() == 0)
if ( line.empty() )
break;
wxString left_str = line.BeforeFirst(':');
@@ -312,7 +312,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
case wxHTTP_POST:
request = wxT("POST");
if ( GetHeader( wxT("Content-Length") ).IsNull() )
if ( GetHeader( wxT("Content-Length") ).empty() )
SetHeader( wxT("Content-Length"), wxString::Format( wxT("%lu"), (unsigned long)m_post_buf.Len() ) );
break;
@@ -323,7 +323,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
m_http_response = 0;
// If there is no User-Agent defined, define it.
if (GetHeader(wxT("User-Agent")).IsNull())
if ( GetHeader(wxT("User-Agent")).empty() )
SetHeader(wxT("User-Agent"), wxT("wxWidgets 2.x"));
// Send authentication information