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

BSONObjBuilder::appendAsNumber is unused.

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: None
    • Component/s: Internal Code
    • Fully Compatible

      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"));
      

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

              Created:
              Updated:
              Resolved: