ams-tschoening commented on a change in pull request #75:
URL: https://github.com/apache/logging-log4cxx/pull/75#discussion_r756902852



##########
File path: src/main/cpp/locationinfo.cpp
##########
@@ -102,6 +120,14 @@ const char* LocationInfo::getFileName() const
        return fileName;
 }
 
+/**
+ *   Return the short file name of the caller.
+ *   @returns file name, may be null.
+ */
+const std::string LocationInfo::getShortFileName() const{

Review comment:
       Wouldn't `const std::string&` make more sense here? This way one doesn't 
rely on compilers optimizing copies away and returning a reference seems always 
safe to me. The other getter even returns `const char*`, though, I prefer 
references if objects are available anyway already.

##########
File path: src/main/cpp/locationinfo.cpp
##########
@@ -102,6 +120,14 @@ const char* LocationInfo::getFileName() const
        return fileName;
 }
 
+/**
+ *   Return the short file name of the caller.
+ *   @returns file name, may be null.

Review comment:
       `may be null` seems wrong to me when returning a non-pointer always. You 
mean `empty` instead?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to