Optimize ObjectID.Hex()

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 1.11.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      EncodeToString internally creates a slice not an array and thus makes unnecessary allocation. Since we know exactly the size of the resulting hex, we can optimize the function by using an array.

            Assignee:
            Qingyang Hu
            Reporter:
            Qingyang Hu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: