minor cleanup
This commit is contained in:
parent
e6f4f18f00
commit
7c28b232a4
@ -37,13 +37,6 @@ struct FileRFile : public FileI {
|
|||||||
// TODO: error check
|
// TODO: error check
|
||||||
_file.seekg(pos);
|
_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);
|
std::vector<uint8_t> chunk(size);
|
||||||
const auto nread = _file.read(reinterpret_cast<char*>(chunk.data()), chunk.size()).gcount();
|
const auto nread = _file.read(reinterpret_cast<char*>(chunk.data()), chunk.size()).gcount();
|
||||||
if (nread != std::numeric_limits<std::streamsize>::max()) {
|
if (nread != std::numeric_limits<std::streamsize>::max()) {
|
||||||
@ -51,7 +44,6 @@ struct FileRFile : public FileI {
|
|||||||
} else {
|
} else {
|
||||||
chunk.clear();
|
chunk.clear();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
_bytes_read += chunk.size();
|
_bytes_read += chunk.size();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user