Remove superfluous memmove calls in mongoc-buffer.c

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.17.0-rc0, 1.17.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
              Reporter:
              Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: