-
Notifications
You must be signed in to change notification settings - Fork 7
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
Memory is safe again #148
base: main
Are you sure you want to change the base?
Memory is safe again #148
Conversation
@@ -77,11 +77,11 @@ private static bool CheckArraysMainPartForEquality(ref char* left, ref char* rig | |||
{ | |||
while (length >= 10) | |||
{ | |||
if ((*(int*)left != *(int*)right) |
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.
Why.....?
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.
What why
?
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.
@uselessgoddess, why did you removed braces? They make code less error prone
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.
Sorry dear @FreePhoenix888, my ide did this
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.
But braces make code error prone:)
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 disagree
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.
if (*(int*)left != *(int*)right | ||
|| *(int*)(left + 2) != *(int*)(right + 2) | ||
|| *(int*)(left + 4) != *(int*)(right + 4) | ||
|| *(int*)(left + 6) != *(int*)(right + 6) | ||
|| *(int*)(left + 8) != *(int*)(right + 8)) |
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.
if (*(int*)left != *(int*)right | |
|| *(int*)(left + 2) != *(int*)(right + 2) | |
|| *(int*)(left + 4) != *(int*)(right + 4) | |
|| *(int*)(left + 6) != *(int*)(right + 6) | |
|| *(int*)(left + 8) != *(int*)(right + 8)) | |
if ((*(int*)left != *(int*)right | |
|| (*(int*)(left + 2) != *(int*)(right + 2)) | |
|| (*(int*)(left + 4) != *(int*)(right + 4)) | |
|| (*(int*)(left + 6) != *(int*)(right + 6)) | |
|| (*(int*)(left + 8) != *(int*)(right + 8))) |
Bump. |
Fix
.Equals
bug from #136