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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.3.2
    • None
    • None
    • None
    • ALL

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: