[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4cxx-dev
Subject:    [jira] [Created] (LOGCXX-443) Return by const reference in Logger::getName()
From:       "Rhys Ulerich (JIRA)" <log4cxx-dev () logging ! apache ! org>
Date:       2014-10-21 0:20:34
Message-ID: JIRA.12749393.1413850810000.301042.1413850834040 () Atlassian ! JIRA
[Download RAW message or body]

Rhys Ulerich created LOGCXX-443:
-----------------------------------

             Summary: Return by const reference in Logger::getName()
                 Key: LOGCXX-443
                 URL: https://issues.apache.org/jira/browse/LOGCXX-443
             Project: Log4cxx
          Issue Type: Bug
            Reporter: Rhys Ulerich
            Assignee: Rhys Ulerich
            Priority: Minor


Any one know why

    const LogString Logger::getName() const { return name; }

within src/main/include/log4cxx/logger.h doesn't return a const reference a la

    const LogString& Logger::getName() const { return name; }

In src/main/include/log4cxx/logstring.h the typedef is just

    typedef std::basic_string<logchar> LogString

which makes me think getName() invocations do needless copying, and
callers are already not permitted to mutate the result.



Discussed at http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/201403.mbox/%3CCAKDqugTe%2Byd9G2JyRm1fwZ_w3_RPO4mMWgmX9tTbzyk0i04oWA%40mail.gmail.com%3E.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic