mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
refactor: Drop unused fclose() from BufferedFile
This was only explicitly used in the tests, where it can be replaced by wrapping the original raw file pointer into a CAutoFile on creation and then calling CAutoFile::fclose(). Also, it was used in LoadExternalBlockFile(), where it can also be replaced by the (implicit call to the) CAutoFile destructor after wrapping the original raw file pointer in a CAutoFile.
This commit is contained in:
@@ -637,25 +637,8 @@ public:
|
||||
src = fileIn;
|
||||
}
|
||||
|
||||
~BufferedFile()
|
||||
{
|
||||
fclose();
|
||||
}
|
||||
|
||||
// Disallow copies
|
||||
BufferedFile(const BufferedFile&) = delete;
|
||||
BufferedFile& operator=(const BufferedFile&) = delete;
|
||||
|
||||
int GetVersion() const { return nVersion; }
|
||||
|
||||
void fclose()
|
||||
{
|
||||
if (src) {
|
||||
::fclose(src);
|
||||
src = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//! check whether we're at the end of the source file
|
||||
bool eof() const {
|
||||
return m_read_pos == nSrcPos && feof(src);
|
||||
|
||||
Reference in New Issue
Block a user