From eb8004c355c1e917b4e30fd2835fde0a585f5c52 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 1 Oct 2020 18:24:45 +0900 Subject: [PATCH] Prefer string::find_first_of(char) where possible --- src/curl.cpp | 2 +- src/s3fs.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index f1bd996..255ea66 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -2355,7 +2355,7 @@ int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/) case CURLE_PEER_FAILED_VERIFICATION: S3FS_PRN_ERR("### CURLE_PEER_FAILED_VERIFICATION"); - first_pos = bucket.find_first_of("."); + first_pos = bucket.find_first_of('.'); if(first_pos != std::string::npos){ S3FS_PRN_INFO("curl returned a CURL_PEER_FAILED_VERIFICATION error"); S3FS_PRN_INFO("security issue found: buckets with periods in their name are incompatible with http"); diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 9002abb..107c2a1 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -3502,7 +3502,7 @@ static int parse_passwd_file(bucketkvmap_t& resmap) // read '=' type kvmap_t kv; for(iter = linelist.begin(); iter != linelist.end(); ++iter){ - first_pos = iter->find_first_of("="); + first_pos = iter->find_first_of('='); if(first_pos == std::string::npos){ continue; } @@ -3523,8 +3523,8 @@ static int parse_passwd_file(bucketkvmap_t& resmap) // read ':' type for(iter = linelist.begin(); iter != linelist.end(); ++iter){ - first_pos = iter->find_first_of(":"); - size_t last_pos = iter->find_last_of(":"); + first_pos = iter->find_first_of(':'); + size_t last_pos = iter->find_last_of(':'); if(first_pos == std::string::npos){ continue; } @@ -4932,7 +4932,7 @@ int main(int argc, char* argv[]) // See issue #128strncasecmp /* if(1 == S3fsCurl::GetSslVerifyHostname()){ - found = bucket.find_first_of("."); + found = bucket.find_first_of('.'); if(found != std::string::npos){ found = s3host.find("https:"); if(found != std::string::npos){