From: Mikko Rasa Date: Fri, 6 Jul 2012 12:33:13 +0000 (+0300) Subject: Very minor refactoring X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=601e088dc38005e4346766a09129a80e81c637f3 Very minor refactoring --- diff --git a/source/fs/path.cpp b/source/fs/path.cpp index c56505e..f12e274 100644 --- a/source/fs/path.cpp +++ b/source/fs/path.cpp @@ -7,8 +7,10 @@ using namespace std; 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]==':'); } +#endif } @@ -63,9 +65,7 @@ bool Path::is_absolute() const 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