mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 11:35:38 -04:00
[librpfile] RpFilePrivate: Remove the unnecessary const std::string&
constructor.
We're just calling strdup() anyway, so we only need the `const char*` constructor, since we can pass filename.c_str() from the public class constructor to the private class constructor.
This commit is contained in:
parent
e4f0df9f01
commit
0eb09f467c
@ -76,13 +76,6 @@ class RpFilePrivate
|
||||
assert(filename != nullptr);
|
||||
this->filename = strdup(filename);
|
||||
}
|
||||
RpFilePrivate(RpFile *q, const string &filename, RpFile::FileMode mode)
|
||||
: q_ptr(q), file(INVALID_HANDLE_VALUE)
|
||||
, mode(mode), gzfd(nullptr), gzsz(-1), devInfo(nullptr)
|
||||
{
|
||||
assert(!filename.empty());
|
||||
this->filename = strdup(filename.c_str());
|
||||
}
|
||||
~RpFilePrivate();
|
||||
|
||||
private:
|
||||
|
@ -235,7 +235,7 @@ RpFile::RpFile(const char *filename, FileMode mode)
|
||||
*/
|
||||
RpFile::RpFile(const string &filename, FileMode mode)
|
||||
: super()
|
||||
, d_ptr(new RpFilePrivate(this, filename, mode))
|
||||
, d_ptr(new RpFilePrivate(this, filename.c_str(), mode))
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ RpFile::RpFile(const char *filename, FileMode mode)
|
||||
*/
|
||||
RpFile::RpFile(const string &filename, FileMode mode)
|
||||
: super()
|
||||
, d_ptr(new RpFilePrivate(this, filename, mode))
|
||||
, d_ptr(new RpFilePrivate(this, filename.c_str(), mode))
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user