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

Get rid of stringToNum in mongo/bson/util/misc.h

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL

      It has only three consumers, it throws an integer on error, which may be causing SERVER-5633, and the cstdlib function strtoul can be used to implement a saner version of the desired operation. I think we just want to use strotoul to write a function with the following signature:

      /**

      • Parse a base-10 unsigned from "str", put the result into "result".
        *
      • Returns true if all the characters of "str" are consumed to produce a valid "result".
        */
        bool parseBase10(const StringData& str, unsigned *result);

            Assignee:
            Unassigned Unassigned
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: