]> git.tdb.fi Git - libs/core.git/commitdiff
Very minor refactoring
authorMikko Rasa <tdb@tdb.fi>
Fri, 6 Jul 2012 12:33:13 +0000 (15:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 6 Jul 2012 12:33:13 +0000 (15:33 +0300)
source/fs/path.cpp

index c56505e907eb3fd9ce756f430f23e6f22aed7bd1..f12e27492709423f0875ecb046b0f6b2724dfd03 100644 (file)
@@ -7,8 +7,10 @@ using namespace std;
 
 namespace {
 
 
 namespace {
 
+#ifdef WIN32
 inline bool is_windows_drive(const std::string &p)
 { return (p.size()==2 && ((p[0]>='A' && p[0]<='Z') || (p[0]>='a' && p[0]<='z')) && p[1]==':'); }
 inline bool is_windows_drive(const std::string &p)
 { return (p.size()==2 && ((p[0]>='A' && p[0]<='Z') || (p[0]>='a' && p[0]<='z')) && p[1]==':'); }
+#endif
 
 }
 
 
 }
 
@@ -63,9 +65,7 @@ bool Path::is_absolute() const
        if(is_windows_drive((*this)[0]))
                return true;
 #endif
        if(is_windows_drive((*this)[0]))
                return true;
 #endif
-       if(path[0]==DIRSEP)
-               return true;
-       return false;
+       return path[0]==DIRSEP;
 }
 
 Path Path::subpath(unsigned start, unsigned count) const
 }
 
 Path Path::subpath(unsigned start, unsigned count) const