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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Unassigned
              Reporter:
              Andrew Morrow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: