minor cleanup

This commit is contained in:
Green Sky 2024-03-16 12:29:39 +01:00
parent e6f4f18f00
commit 7c28b232a4
No known key found for this signature in database

View File

@ -37,13 +37,6 @@ struct FileRFile : public FileI {
// TODO: error check
_file.seekg(pos);
#if 0
std::vector<uint8_t> chunk;
int read_char;
for (size_t i = 0; i < size && (_file_size == 0 || i+pos < _file_size) && (read_char = _file.get()) != std::ifstream::traits_type::eof(); i++) {
chunk.push_back(read_char);
}
#else
std::vector<uint8_t> chunk(size);
const auto nread = _file.read(reinterpret_cast<char*>(chunk.data()), chunk.size()).gcount();
if (nread != std::numeric_limits<std::streamsize>::max()) {
@ -51,7 +44,6 @@ struct FileRFile : public FileI {
} else {
chunk.clear();
}
#endif
_bytes_read += chunk.size();