From 2ec91dbe6ba9a786970711b7fa2812c1211cb36f Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 22 Dec 2019 21:00:50 -0330 Subject: [PATCH] Remove virtual designation for FSNode::setFlags, since it's never needed. --- src/unix/FSNodePOSIX.cxx | 38 +++++++++++++++++------------------ src/unix/FSNodePOSIX.hxx | 2 +- src/windows/FSNodeWINDOWS.hxx | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index 767041237..034d86211 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -23,25 +23,6 @@ #include "FSNodePOSIX.hxx" -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FilesystemNodePOSIX::setFlags() -{ - struct stat st; - - _isValid = (0 == stat(_path.c_str(), &st)); - if(_isValid) - { - _isDirectory = S_ISDIR(st.st_mode); - _isFile = S_ISREG(st.st_mode); - - // Add a trailing slash, if necessary - if (_isDirectory && _path.length() > 0 && _path[_path.length()-1] != '/') - _path += '/'; - } - else - _isDirectory = _isFile = false; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodePOSIX::FilesystemNodePOSIX() : _path(ROOT_DIR), @@ -82,6 +63,25 @@ FilesystemNodePOSIX::FilesystemNodePOSIX(const string& path, bool verify) setFlags(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FilesystemNodePOSIX::setFlags() +{ + struct stat st; + + _isValid = (0 == stat(_path.c_str(), &st)); + if(_isValid) + { + _isDirectory = S_ISDIR(st.st_mode); + _isFile = S_ISREG(st.st_mode); + + // Add a trailing slash, if necessary + if (_isDirectory && _path.length() > 0 && _path[_path.length()-1] != '/') + _path += '/'; + } + else + _isDirectory = _isFile = false; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string FilesystemNodePOSIX::getShortPath() const { diff --git a/src/unix/FSNodePOSIX.hxx b/src/unix/FSNodePOSIX.hxx index fdd964e70..b65eda523 100644 --- a/src/unix/FSNodePOSIX.hxx +++ b/src/unix/FSNodePOSIX.hxx @@ -88,7 +88,7 @@ class FilesystemNodePOSIX : public AbstractFSNode * Tests and sets the _isValid and _isDirectory/_isFile flags, * using the stat() function. */ - virtual void setFlags(); + void setFlags(); /** * Returns the last component of a given path. diff --git a/src/windows/FSNodeWINDOWS.hxx b/src/windows/FSNodeWINDOWS.hxx index a181a185d..6d0e3ed37 100644 --- a/src/windows/FSNodeWINDOWS.hxx +++ b/src/windows/FSNodeWINDOWS.hxx @@ -86,7 +86,7 @@ class FilesystemNodeWINDOWS : public AbstractFSNode * Tests and sets the _isValid and _isDirectory/_isFile flags, * using the GetFileAttributes() function. */ - virtual void setFlags(); + void setFlags(); /** * Adds a single FilesystemNodeWINDOWS to a given list.