small improvement

This commit is contained in:
Laurent Perron
2021-11-30 08:52:56 +01:00
parent 375caecc04
commit b61d189ffc

View File

@@ -20,7 +20,7 @@
// * Consecutive '\n' result in empty lines being produced.
// * If not empty, the string after the last '\n' is produced as the last line.
// * Options are available to keep the trailing '\n' for each line, to remove
// carriage-return chararters ('\r'), and to remove blank lines.
// carriage-return characters ('\r'), and to remove blank lines.
//
#ifndef OR_TOOLS_UTIL_FILELINEITER_H_
#define OR_TOOLS_UTIL_FILELINEITER_H_
@@ -115,7 +115,10 @@ class FileLineIterator {
class FileLines {
public:
FileLines(const std::string& filename, int options) : options_(options) {
if (!file::Open(filename, "r", &file_, file::Defaults()).ok()) return;
if (!file::Open(filename, "r", &file_, file::Defaults()).ok()) {
LOG(WARNING) << "Could not open: " << filename;
return;
}
}
explicit FileLines(const std::string& filename)