[CDRIVER-3672] Remove superfluous memmove calls in mongoc-buffer.c Created: 14/May/20  Updated: 28/Oct/23  Resolved: 16/Jun/20

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.17.0-rc0, 1.17.0

Type: Improvement Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Andrew Witten (Inactive)
Resolution: Fixed Votes: 0
Labels: new-eng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2266 Superfluous `off` in mongoc_buffer_t Closed

 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.



 Comments   
Comment by Githook User [ 11/Jul/20 ]

Author:

{'name': 'Andrew Witten', 'email': 'awitten1@terpmail.umd.edu', 'username': 'awitten1'}

Message: CDRIVER-3672 removed superflous memmove calls

Co-authored-by: Andrew Witten <andrew.witten@Andrews-MacBook-Pro.local>
Branch: r1.17
https://github.com/mongodb/mongo-c-driver/commit/7454162364bc90254e5af5c02ff14a035b2fa0e1

Comment by Githook User [ 16/Jun/20 ]

Author:

{'name': 'Andrew Witten', 'email': 'awitten1@terpmail.umd.edu', 'username': 'awitten1'}

Message: CDRIVER-3672 removed superflous memmove calls

Co-authored-by: Andrew Witten <andrew.witten@Andrews-MacBook-Pro.local>
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5cb599280fb3f3eb7081b7db3df4a612e1428464

Comment by Andrew Witten (Inactive) [ 16/Jun/20 ]

PR: https://github.com/mongodb/mongo-c-driver/pull/638

Generated at Wed Feb 07 21:18:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.