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

XMLWordPrintableJSON

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

      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
            Reporter:
            Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: