use empty to check string

This commit is contained in:
Jacek Jendrzej
2015-01-09 17:15:11 +01:00
parent aea7e1f772
commit 2b5e7b5ba3
34 changed files with 170 additions and 170 deletions

View File

@@ -99,9 +99,9 @@ void CLanguage::setLanguage(std::string _language){
//-----------------------------------------------------------------------------
std::string CLanguage::getTranslation(std::string id){
std::string trans=ConfigLanguage->getString(id,"");
if(trans=="")
if(trans.empty())
trans=NeutrinoLanguage->getString(id,"");
if(trans=="")
if(trans.empty())
trans=DefaultLanguage->getString(id,"");
return trans;
}

View File

@@ -59,7 +59,7 @@ bool CWebserverRequest::HandleRequest(void) {
start_line = Connection->sock->ReceiveLine();
if (!Connection->sock->isValid)
return false;
if (start_line == "") // Socket empty
if (start_line.empty()) // Socket empty
{
log_level_printf(1, "HandleRequest: End of line not found\n");
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
@@ -82,7 +82,7 @@ bool CWebserverRequest::HandleRequest(void) {
return false;
}
if (tmp_line == "") {
if (tmp_line.empty()) {
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
return false;
}
@@ -252,7 +252,7 @@ bool CWebserverRequest::HandlePost() {
std::string raw_header = "", tmp_line = "";
do {
tmp_line = Connection->sock->ReceiveLine();
if (tmp_line == "") // Socket empty
if (tmp_line.empty()) // Socket empty
{
log_level_printf(1,
"HandleRequest: (Header) End of line not found: %s\n",
@@ -266,7 +266,7 @@ bool CWebserverRequest::HandlePost() {
// read meesage body
unsigned int content_len = 0;
if (HeaderList["Content-Length"] != "")
if (!HeaderList["Content-Length"].empty())
content_len = atoi(HeaderList["Content-Length"].c_str());
// Get Rest of Request from Socket

View File

@@ -116,12 +116,12 @@ bool CySocket::initSSL(void)
aprintf("ySocket:SSL Error: Create SSL_CTX_new : %s\n", ERR_error_string(ERR_get_error(), NULL) );
return false;
}
if(SSL_pemfile == "")
if(SSL_pemfile.empty())
{
aprintf("ySocket:SSL Error: no pemfile given\n");
return false;
}
if(SSL_CA_file != "") // have a CA?
if(!SSL_CA_file.empty()) // have a CA?
if(1 != SSL_CTX_load_verify_locations(SSL_ctx, SSL_CA_file.c_str(), NULL))
{
aprintf("ySocket:SSL Error: %s CA-File:%s\n",ERR_error_string(ERR_get_error(), NULL), SSL_CA_file.c_str());