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

BSONObjBuilder::appendAsNumber is unused.

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.1.7
    • Internal Code
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: