Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9757

Returning an OK mongo::Status should be a trivial operation

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.1
    • None
    • None
    • None
    • ALL

    Description

      Currently, a function that returns "Status::OK" is not efficiently generated, since the call to construct the OK status is not inlined (see getOKInfo). Furthermore, since getOKInfo uses a function scoped static, the code generated for getOKInfo is suboptimal.

      We should refactor Status so that its lifecycle methods are inlined, and so that we no longer require the function scoped static (and related static initializer). The easiest way to do this is to make a Status containing a null pointer mean 'OK', and only populate the error pointer if there is actual error state to return.

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: