[SERVER-8477] Extra return statement in DBException::toString() Created: 08/Feb/13  Updated: 11/Jul/16  Resolved: 28/Aug/13

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Bug Priority: Trivial - P5
Reporter: Tad Marshall Assignee: Matt Kangas
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The definition of DBException::toString() at line 57 in src/mongo/util/assert_util.cpp contains a redundant return statement:

    string DBException::toString() const {
        stringstream ss; ss << getCode() << " " << what(); return ss.str();
        return ss.str();
    }

This would have been more obvious if the routine didn't have three statements on one line.



 Comments   
Comment by auto [ 28/Aug/13 ]

Author:

{u'username': u'mohyt', u'name': u'Mohit Srivastava', u'email': u'srivastavamohit91@gmail.com'}

Message: SERVER-8477 Remove extra return statement from DBException::toString()

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/c0e30cdd562359d5f3c9afd78bf77fe35cc439d4

Comment by Mohit Srivastava [ 25/Aug/13 ]

I already added a patch on it. And sent a pull request.

Generated at Thu Feb 08 03:17:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.