mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 02:02:24 +00:00
Fix compiler warnings
Optimize codes.
This commit is contained in:
3 files changed
+8
-7
No files matched your search
+4
-4
@@ -75,11 +75,11 @@ std::shared_future<std::string> fetchFileAsync(const std::string &path, const st
|
||||
{
|
||||
std::shared_future<std::string> 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;
|
||||
|
||||
Reference in new issue
Block a user