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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user