Changed to using an "operator bool" instead of an "operator void*"
and avoid returning a pointer to the current object. In the new
"operator bool" implementation, check the filename object first
since many times we have FileSpec objects with a filename, yet no
directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139488 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Host/common/FileSpec.cpp b/source/Host/common/FileSpec.cpp
index ba9f920..8f398e0 100644
--- a/source/Host/common/FileSpec.cpp
+++ b/source/Host/common/FileSpec.cpp
@@ -352,10 +352,9 @@
// if (file_spec)
// {}
//----------------------------------------------------------------------
-FileSpec::operator
-void*() const
+FileSpec::operator bool() const
{
- return (m_directory || m_filename) ? const_cast<FileSpec*>(this) : NULL;
+ return m_filename || m_directory;
}
//----------------------------------------------------------------------