Contradicting comments removed

This commit is contained in:
ANSHUMAN TRIPATHY 2019-03-31 21:36:16 +05:30
parent 0a25f061dd
commit 7375586f21

View File

@ -34,15 +34,11 @@ namespace tflite {
FileCopyAllocation::FileCopyAllocation(const char* filename, FileCopyAllocation::FileCopyAllocation(const char* filename,
ErrorReporter* error_reporter) ErrorReporter* error_reporter)
: Allocation(error_reporter, Allocation::Type::kFileCopy) { : Allocation(error_reporter, Allocation::Type::kFileCopy) {
// Obtain the file size, using an alternative method that is does not
// require fstat for more compatibility.
std::unique_ptr<FILE, decltype(&fclose)> file(fopen(filename, "rb"), fclose); std::unique_ptr<FILE, decltype(&fclose)> file(fopen(filename, "rb"), fclose);
if (!file) { if (!file) {
error_reporter_->Report("Could not open '%s'.", filename); error_reporter_->Report("Could not open '%s'.", filename);
return; return;
} }
// TODO(ahentz): Why did you think using fseek here was better for finding
// the size?
struct stat sb; struct stat sb;
// support usage of msvc's posix-like fileno symbol // support usage of msvc's posix-like fileno symbol