aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-07-18 11:15:15 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-07-18 13:48:05 +0000
commit840f24c5af8ad7027037d688baed37ad8d388980 (patch)
tree313563396106ab2b4e10811a7457a9513d479607
parent21a8b5ece4b8f0db0fb39b3eea2ee5defc425434 (diff)
GC unused SetFileName
-rw-r--r--vespalib/src/vespa/fastos/file.cpp11
-rw-r--r--vespalib/src/vespa/fastos/file.h30
-rw-r--r--vespalib/src/vespa/fastos/unix_file.cpp2
3 files changed, 11 insertions, 32 deletions
diff --git a/vespalib/src/vespa/fastos/file.cpp b/vespalib/src/vespa/fastos/file.cpp
index c8cce99b169..44c8ee8025e 100644
--- a/vespalib/src/vespa/fastos/file.cpp
+++ b/vespalib/src/vespa/fastos/file.cpp
@@ -40,13 +40,11 @@ static const size_t MAX_CHUNK_SIZE = 0x4000000; // 64 MB
FastOS_FileInterface::FastOS_FileInterface(const char *filename)
: _fAdviseOptions(_defaultFAdviseOptions),
_chunkSize(MAX_CHUNK_SIZE),
- _filename(),
+ _filename(filename != nullptr ? filename : ""),
_openFlags(0),
_directIOEnabled(false),
_syncWritesEnabled(false)
{
- if (filename != nullptr)
- SetFileName(filename);
}
@@ -207,13 +205,6 @@ FastOS_FileInterface::IsMemoryMapped() const
return false;
}
-void
-FastOS_FileInterface::SetFileName(const char *filename)
-{
- _filename = filename;
-}
-
-
const char *
FastOS_FileInterface::GetFileName() const
{
diff --git a/vespalib/src/vespa/fastos/file.h b/vespalib/src/vespa/fastos/file.h
index 84b94df5acc..8f155fe54a5 100644
--- a/vespalib/src/vespa/fastos/file.h
+++ b/vespalib/src/vespa/fastos/file.h
@@ -99,7 +99,7 @@ public:
/**
* Constructor. A filename could be supplied at this point, or specified
- * later using @ref SetFileName() or @ref Open().
+ * later using @ref Open().
* @param filename a filename (optional)
*/
FastOS_FileInterface(const char *filename=nullptr);
@@ -111,14 +111,6 @@ public:
virtual ~FastOS_FileInterface();
/**
- * Associate a new filename with this object. This filename will be
- * used when performing @ref Open() (unless @ref Open() specifies a
- * different filename).
- * @param filename filename character string (will be copied internally)
- */
- virtual void SetFileName(const char *filename);
-
- /**
* Return the filename associated with the File object. If no filename
* has been set, an empty string is returned instead.
* @return The filename associated with the File object
@@ -136,8 +128,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to
- * @ref Open().
+ * or a previous call to @ref Open().
* @return Boolean success/failure
*/
virtual bool Open(unsigned int openFlags, const char *filename=nullptr) = 0;
@@ -148,7 +139,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to @ref Open().
+ * or a previous call to @ref Open().
* @return Boolean success/failure
*/
bool OpenReadWrite(const char *filename=nullptr);
@@ -160,7 +151,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to
+ * or a previous call to
* @ref Open().
* @return Boolean success/failure
*/
@@ -173,8 +164,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to
- * @ref Open().
+ * or a previous call to @ref Open().
* @return Boolean success/failure
*/
bool OpenReadOnlyExisting (bool abortIfNotExist=false, const char *filename=nullptr);
@@ -185,8 +175,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to
- * @ref Open().
+ * or a previous call to @ref Open().
* @return Boolean success/failure
*/
bool OpenWriteOnlyTruncate(const char *filename=nullptr);
@@ -198,8 +187,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to
- * @ref Open().
+ * or a previous call to @ref Open().
* @return Boolean success/failure
*/
bool OpenWriteOnlyExisting (bool abortIfNotExist=false, const char *filename=nullptr);
@@ -210,7 +198,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to @ref Open().
+ * or a previous call to @ref Open().
* @return Boolean success/failure
*/
bool OpenReadOnly(const char *filename=nullptr);
@@ -221,7 +209,7 @@ public:
* @param filename You may optionally specify a filename here. This
* will replace the currently associated filename
* (if any) set using either the constructor,
- * @ref SetFileName() or a previous call to @ref Open().
+ * or a previous call to Open().
* @return Boolean success/failure
*/
bool OpenWriteOnly(const char *filename=nullptr);
diff --git a/vespalib/src/vespa/fastos/unix_file.cpp b/vespalib/src/vespa/fastos/unix_file.cpp
index 952d9820306..4d0245cd079 100644
--- a/vespalib/src/vespa/fastos/unix_file.cpp
+++ b/vespalib/src/vespa/fastos/unix_file.cpp
@@ -208,7 +208,7 @@ FastOS_UNIX_File::Open(unsigned int openFlags, const char *filename)
assert(_filedes == -1);
if (filename != nullptr) {
- SetFileName(filename);
+ _filename = filename;
}
unsigned int accessFlags = CalcAccessFlags(openFlags);