From 81805715bdcd50843170fff1c7adf1f19b72addf Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 17 Sep 2020 19:56:35 +0900 Subject: [PATCH] Remove unnecessary calls to strcmp(str.c_str()) --- src/curl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index b67142c..4f6fc7e 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -2473,15 +2473,15 @@ std::string S3fsCurl::CalcSignature(const std::string& method, const std::string uriencode = urlEncode(canonical_uri); StringCQ = method + "\n"; - if(0 == strcmp(method.c_str(),"HEAD") || 0 == strcmp(method.c_str(),"PUT") || 0 == strcmp(method.c_str(),"DELETE")){ + if(method == "HEAD" || method == "PUT" || method == "DELETE"){ StringCQ += uriencode + "\n"; - }else if (0 == strcmp(method.c_str(), "GET") && 0 == strcmp(uriencode.c_str(), "")) { + }else if(method == "GET" && uriencode.empty()){ StringCQ +="/\n"; - }else if (0 == strcmp(method.c_str(), "GET") && 0 == strncmp(uriencode.c_str(), "/", 1)) { + }else if(method == "GET" && uriencode == "/"){ StringCQ += uriencode +"\n"; - }else if (0 == strcmp(method.c_str(), "GET") && 0 != strncmp(uriencode.c_str(), "/", 1)) { + }else if(method == "GET" && uriencode != "/"){ StringCQ += "/\n" + urlEncode2(canonical_uri) +"\n"; - }else if (0 == strcmp(method.c_str(), "POST")) { + }else if(method == "POST"){ StringCQ += uriencode + "\n"; } StringCQ += urlEncode2(query_string) + "\n";