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

BSONObjBuilder::appendAsNumber is unused.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.7
    • Component/s: Internal Code
    • Labels:
    • Backwards Compatibility:
      Fully Compatible

      Description

      This method is unused, since https://github.com/mongodb/mongo/commit/4b033ae930afded6677c19022341241935992b33.

      A git grep 'appendAsNumber' on master reveals:

      src/mongo/bson/bsonobjbuilder.cpp:bool BSONObjBuilder::appendAsNumber(StringData fieldName, const string& data) {
      src/mongo/bson/bsonobjbuilder.h:    bool appendAsNumber(StringData fieldName, const std::string& data);
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(b.appendAsNumber("a", "1"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(b.appendAsNumber("b", "1.1"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(b.appendAsNumber("c", "-1"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(b.appendAsNumber("d", "-1.1"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(b.appendAsNumber("e", "32131231231232313"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(!b.appendAsNumber("f", "zz"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(!b.appendAsNumber("f", "5zz"));
      src/mongo/dbtests/jsobjtests.cpp:        ASSERT(!b.appendAsNumber("f", "zz5"));
      

        Attachments

          Activity

            People

            Assignee:
            david.hatch David Hatch
            Reporter:
            david.hatch David Hatch
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: