Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3672

Remove superfluous memmove calls in mongoc-buffer.c

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 1.17.0-rc0, 1.17.0
    • None

    Description

      A mongoc_buffer_t is a small struct with a data pointer, data length, capacity, and reallocation function.

      Originally, it also had an offset field, which was removed in this commit: CDRIVER-2266

      A side-effect of that is there are three lines like:

      memmove (&buffer->data[0], buffer->data, buffer->len);
      

      Which are effectively no-ops.

      One case was removed in https://github.com/mongodb/mongo-c-driver/commit/26137b5c0883bd0705833c0ec9212694d9c88650 but three still remain.

      Attachments

        Issue Links

          Activity

            People

              andrew.witten@mongodb.com Andrew Witten (Inactive)
              kevin.albertson@mongodb.com Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: