Unnecessary use of sizeof() #3
Reference in New Issue
Block a user
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
The "size of" the data type char is always going to be one byte. The math in calculating names of players or the map doesn't need sizeof() calls, especially with a data type that is only one byte.
Multiplying numbers by one is useless.
Hey, thanks the interest you have in this project.
The use of sizeof() when allocating memory is good practice, even if sizeof(char) is always 1 on modern hardware.
The multiplication you're talking about will be evaluated at compile time, thus resulting in the exact same assembly code.
Pull request closed