Skip to content

Commit

Permalink
Simplify file_size function implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
barnasm1 committed Jan 29, 2025
1 parent 664b578 commit 3227347
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/common/util/include/openvino/util/file_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,8 @@ file_size(const char* path) {

inline int64_t file_size(const ov::util::Path& path) {
std::error_code ec;
if (const std::uintmax_t size = std::filesystem::file_size(path, ec); ec) {
return -1;
} else {
return static_cast<int64_t>(size);
}
const auto size = std::filesystem::file_size(path, ec);
return ec ? -1 : static_cast<int64_t>(size);
}

/**
Expand Down

0 comments on commit 3227347

Please sign in to comment.