-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qvector replace unnecessary code #114
Conversation
src/containers/qvector.c
Outdated
memcpy(tmp, data1, vector->objsize); | ||
memcpy(data1, data2, vector->objsize); | ||
memcpy(data2, tmp, vector->objsize); | ||
for (int k = 0; k < vector->objsize; k++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the behavior of the qvector_reverse() is to reverse the order of the elements, not the byte order inside the elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Plz ignore the above comment. I misread.
But performance-wise, how will it compare?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need call malloc
Hi Hojun, Thanks for your PR. |
First, thank you for time. I agree with you. |
Hi Hojun, Oh sorry, I misread your code. Yeah, your update doesn't change the behavior. |
I agree with you. How about discard for-loop commit? |
I'm good with that. We're good to go with 20d7435 |
Copying bytes in for loop. It feels that's too much for removing a
temporary malloc.
…On Wed, May 15, 2024, 2:37 AM O_WRONLY ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/containers/qvector.c
<#114 (comment)>:
>
- memcpy(tmp, data1, vector->objsize);
- memcpy(data1, data2, vector->objsize);
- memcpy(data2, tmp, vector->objsize);
+ for (int k = 0; k < vector->objsize; k++) {
don't need call malloc
—
Reply to this email directly, view it on GitHub
<#114 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUKQMKR7NUZPPXXNIFVL7DZCJDUBAVCNFSM6AAAAABHTMNDCKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANJWGAZDQNJWGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I didn't think of that. Thank you for your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again for a great PR!!!
I add commit about replaced unnecessary code.