mirror of
https://github.com/rui314/mold.git
synced 2024-09-19 08:57:39 +03:00
Optimize
Teaching the compiler that `buflen` cannot be negative and also doesn't take a large value allows it to optimize code a little bit more than it currently does.
This commit is contained in:
parent
ca4738d5e2
commit
416b0d336f
@ -739,7 +739,7 @@ public:
|
||||
private:
|
||||
u64 v0, v1, v2, v3;
|
||||
u8 buf[8];
|
||||
i64 buflen = 0;
|
||||
u8 buflen = 0;
|
||||
i64 total_bytes = 0;
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,7 @@ SipHash::SipHash(u8 *key) {
|
||||
void SipHash::update(u8 *msg, i64 msglen) {
|
||||
total_bytes += msglen;
|
||||
|
||||
if (buflen > 0) {
|
||||
if (buflen) {
|
||||
if (buflen + msglen < 8) {
|
||||
memcpy(buf + buflen, msg, msglen);
|
||||
buflen += msglen;
|
||||
|
Loading…
Reference in New Issue
Block a user