]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/sg_path.cxx
cppbind: automatic conversion of SGReferenced derived pointers.
[simgear.git] / simgear / misc / sg_path.cxx
index 69d1ac4494f73302181f4a0693afb63918d42824..4e11de3c305e4cb3a0c3e45610599fb827aa5e41 100644 (file)
@@ -144,7 +144,7 @@ void SGPath::set_cached(bool cached)
 
 // append another piece to the existing path
 void SGPath::append( const string& p ) {
-    if ( path.size() == 0 ) {
+    if ( path.empty() ) {
         path = p;
     } else {
     if ( p[0] != sgDirPathSep ) {
@@ -173,7 +173,7 @@ void SGPath::add( const string& p ) {
 // concatenate a string to the end of the path without inserting a
 // path separator
 void SGPath::concat( const string& p ) {
-    if ( path.size() == 0 ) {
+    if ( path.empty() ) {
         path = p;
     } else {
         path += p;
@@ -378,7 +378,7 @@ int SGPath::create_dir( mode_t mode ) {
 string_list sgPathBranchSplit( const string &dirpath ) {
     string_list path_elements;
     string element, path = dirpath;
-    while ( path.size() ) {
+    while ( ! path.empty() ) {
         size_t p = path.find( sgDirPathSep );
         if ( p != string::npos ) {
             element = path.substr( 0, p );
@@ -387,7 +387,7 @@ string_list sgPathBranchSplit( const string &dirpath ) {
             element = path;
             path = "";
         }
-        if ( element.size() )
+        if ( ! element.empty() )
             path_elements.push_back( element );
     }
     return path_elements;