Correct usage of istringstream (#1670)

Previously this looped one more time than necessary due to the eof
check:

https://isocpp.org/wiki/faq/input-output#istream-and-eof

Remove now redundant empty check.
This commit is contained in:
Andrew Gaul
2021-06-02 07:14:32 +09:00
committed by GitHub
parent f5701fa9ad
commit 53dfd48f59

View File

@ -424,12 +424,8 @@ bool S3fsCurl::InitMimeType(const std::string& strFile)
std::istringstream tmp(line);
std::string mimeType;
tmp >> mimeType;
while(tmp){
std::string ext;
tmp >> ext;
if(ext.empty()){
continue;
}
std::string ext;
while(tmp >> ext){
S3fsCurl::mimeTypes[ext] = mimeType;
}
}