Skip to content

Commit 042cf27

Browse files
committed
fix(count_file_lines): remove the EOF check
std::istreambuf_iterator will not set the eofbit.
1 parent f3e8c82 commit 042cf27

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

comms/torchcomms/TorchCommUtils.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ int count_file_lines(const std::string& filepath, bool ignore_empty_lines) {
9595

9696
if (filestream.bad()) {
9797
throw std::runtime_error("Error while reading file: " + filepath);
98-
} else if (!filestream.eof()) {
99-
throw std::runtime_error("File read did not reach EOF: " + filepath);
10098
}
10199

102100
return line_count;

0 commit comments

Comments
 (0)