From f736a2e8b3addf55f22b7424b987657b9432af29 Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Sat, 21 Mar 2020 17:47:53 +0800 Subject: [PATCH] Fix compiler warnings Optimize codes. --- src/interfaces.cpp | 2 +- src/misc.cpp | 5 +++-- src/multithread.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/interfaces.cpp b/src/interfaces.cpp index 7971cdc..c31ad46 100644 --- a/src/interfaces.cpp +++ b/src/interfaces.cpp @@ -344,7 +344,7 @@ void refreshRulesets(string_array &ruleset_list, std::vector &r { writeLog(0, "Adding rule '" + rule_url.substr(2) + "," + rule_group + "'.", LOG_LEVEL_INFO); //std::cerr<<"Adding rule '"< fetchFileAsync(const std::string &path, const st { std::shared_future retVal; if(fileExist(path)) - retVal = std::move(std::async(std::launch::async, [path](){return fileGet(path, true);})); - else if(startsWith(path, "https://") || startsWith(path, "http://")) - retVal = std::move(std::async(std::launch::async, [path, proxy, cache_ttl](){return webGet(path, proxy, cache_ttl);})); + retVal = std::async(std::launch::async, [path](){return fileGet(path, true);}); + else if(startsWith(path, "https://") || startsWith(path, "http://") || startsWith(path, "data:")) + retVal = std::async(std::launch::async, [path, proxy, cache_ttl](){return webGet(path, proxy, cache_ttl);}); else - return std::move(std::async(std::launch::async, [](){return std::string();})); + return std::async(std::launch::async, [](){return std::string();}); if(!async) retVal.wait(); return retVal;