diff --git a/src/TNL/Object.cpp b/src/TNL/Object.cpp index 14418d26da1412d8f3785fce4f0c76fb0391e948..74a4bbb7a18f3658b6815fc60525cd8a6a04fce4 100644 --- a/src/TNL/Object.cpp +++ b/src/TNL/Object.cpp @@ -85,14 +85,10 @@ bool Object :: save( const String& fileName ) const std::cerr << "I am not bale to open the file " << fileName << " for writing." << std::endl; return false; } - if( ! this->save( file ) ) - return false; + const bool status = this->save( file ); if( ! file. close() ) - { std::cerr << "An error occurred when I was closing the file " << fileName << "." << std::endl; - return false; - } - return true; + return status; } bool Object :: load( const String& fileName ) @@ -103,14 +99,10 @@ bool Object :: load( const String& fileName ) std::cerr << "I am not bale to open the file " << fileName << " for reading." << std::endl; return false; } - if( ! this->load( file ) ) - return false; + const bool status = this->load( file ); if( ! file. close() ) - { std::cerr << "An error occurred when I was closing the file " << fileName << "." << std::endl; - return false; - } - return true; + return status; } bool Object :: boundLoad( const String& fileName )