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

Remove superfluous memmove calls in mongoc-buffer.c

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.17.0-rc0, 1.17.0
    • Affects Version/s: None
    • Component/s: None

      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.

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

              Created:
              Updated:
              Resolved: