aboutsummaryrefslogtreecommitdiff
path: root/src/streams.h
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-09-11 17:30:31 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-09-12 12:35:13 +0200
commitfa2f2413b87f5fc1e5c92bf510beebdcd0091714 (patch)
tree5da2331d1f813401b6f2796edff9d366cb8ed944 /src/streams.h
parent5c2b3cd4b856f1bb536daaf7f576b1b1b42293ca (diff)
downloadbitcoin-fa2f2413b87f5fc1e5c92bf510beebdcd0091714.tar.xz
Remove unused GetType() from CBufferedFile and CAutoFile
GetType() is only called in tests, so it is unused and can be removed.
Diffstat (limited to 'src/streams.h')
-rw-r--r--src/streams.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/streams.h b/src/streams.h
index 5ff952be76..eec9c0956b 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -550,12 +550,10 @@ public:
class CAutoFile : public AutoFile
{
private:
- const int nType;
const int nVersion;
public:
- explicit CAutoFile(std::FILE* file, int type, int version, std::vector<std::byte> data_xor = {}) : AutoFile{file, std::move(data_xor)}, nType{type}, nVersion{version} {}
- int GetType() const { return nType; }
+ explicit CAutoFile(std::FILE* file, int version, std::vector<std::byte> data_xor = {}) : AutoFile{file, std::move(data_xor)}, nVersion{version} {}
int GetVersion() const { return nVersion; }
template<typename T>
@@ -582,7 +580,6 @@ public:
class CBufferedFile
{
private:
- const int nType;
const int nVersion;
FILE *src; //!< source file
@@ -632,8 +629,8 @@ private:
}
public:
- CBufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn)
- : nType(nTypeIn), nVersion(nVersionIn), nReadLimit(std::numeric_limits<uint64_t>::max()), nRewind(nRewindIn), vchBuf(nBufSize, std::byte{0})
+ CBufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nVersionIn)
+ : nVersion{nVersionIn}, nReadLimit{std::numeric_limits<uint64_t>::max()}, nRewind{nRewindIn}, vchBuf(nBufSize, std::byte{0})
{
if (nRewindIn >= nBufSize)
throw std::ios_base::failure("Rewind limit must be less than buffer size");
@@ -650,7 +647,6 @@ public:
CBufferedFile& operator=(const CBufferedFile&) = delete;
int GetVersion() const { return nVersion; }
- int GetType() const { return nType; }
void fclose()
{