vfs_static: Remove template byte parameter from StaticVfsFile

This converts it into a regular constructor parameter. There's no need
to make this a template parameter on the class when it functions
perfectly well as a constructor argument.

This also reduces the amount of code bloat produced by the compiler, as
it doesn't need to generate the same code for multiple different
instantiations of the same class type, but with a different fill value.
This commit is contained in:
Lioncash
2018-09-25 17:26:09 -04:00
parent 7b81e1e525
commit 14e2df5610
4 changed files with 42 additions and 42 deletions

View File

@ -12,11 +12,11 @@
namespace FileSys {
template <u8 value>
class StaticVfsFile : public VfsFile {
public:
explicit StaticVfsFile(size_t size = 0, std::string name = "", VirtualDir parent = nullptr)
: size(size), name(std::move(name)), parent(std::move(parent)) {}
explicit StaticVfsFile(u8 value, size_t size = 0, std::string name = "",
VirtualDir parent = nullptr)
: value{value}, size{size}, name{std::move(name)}, parent{std::move(parent)} {}
std::string GetName() const override {
return name;
@ -70,6 +70,7 @@ public:
}
private:
u8 value;
size_t size;
std::string name;
VirtualDir parent;