DataReader: In-class initialize member variables where applicable

Allows the default constructor to be defaulted and ensures the default
values are associated with the member variables directly.

Also corrects a prefixed underscore in the two parameter constructor.
This commit is contained in:
Lioncash 2018-03-18 16:34:48 -04:00
parent fd956f6c69
commit 4c2ec39199
1 changed files with 4 additions and 4 deletions

View File

@ -13,8 +13,8 @@
class DataReader class DataReader
{ {
public: public:
__forceinline DataReader() : buffer(nullptr), end(nullptr) {} __forceinline DataReader() = default;
__forceinline DataReader(u8* src, u8* _end) : buffer(src), end(_end) {} __forceinline DataReader(u8* src, u8* end_) : buffer(src), end(end_) {}
__forceinline u8* GetPointer() { return buffer; } __forceinline u8* GetPointer() { return buffer; }
__forceinline u8* operator=(u8* src) __forceinline u8* operator=(u8* src)
{ {
@ -60,6 +60,6 @@ public:
} }
private: private:
u8* __restrict buffer; u8* __restrict buffer = nullptr;
u8* end; u8* end = nullptr;
}; };