[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:
David Korth 2023-07-23 18:31:11 -04:00
parent e4f0df9f01
commit 0eb09f467c
3 changed files with 2 additions and 9 deletions

View File

@ -76,13 +76,6 @@ class RpFilePrivate
assert(filename != nullptr); assert(filename != nullptr);
this->filename = strdup(filename); 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(); ~RpFilePrivate();
private: private:

View File

@ -235,7 +235,7 @@ RpFile::RpFile(const char *filename, FileMode mode)
*/ */
RpFile::RpFile(const string &filename, FileMode mode) RpFile::RpFile(const string &filename, FileMode mode)
: super() : super()
, d_ptr(new RpFilePrivate(this, filename, mode)) , d_ptr(new RpFilePrivate(this, filename.c_str(), mode))
{ {
init(); init();
} }

View File

@ -295,7 +295,7 @@ RpFile::RpFile(const char *filename, FileMode mode)
*/ */
RpFile::RpFile(const string &filename, FileMode mode) RpFile::RpFile(const string &filename, FileMode mode)
: super() : super()
, d_ptr(new RpFilePrivate(this, filename, mode)) , d_ptr(new RpFilePrivate(this, filename.c_str(), mode))
{ {
init(); init();
} }