diff options
author | Jeff Garzik <jeff@garzik.org> | 2011-02-17 01:22:55 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2011-02-17 01:22:55 -0500 |
commit | 1083e15c47539133a0e5075bb3d9f2b7741633f3 (patch) | |
tree | dc8a1fbf3098720fd31ba6f33ce36680267cb9e2 /sha256_cryptopp.c | |
parent | f0bdc0b6f9f19c603f5e34332fa0d4e5bb3ea973 (diff) |
Mark hash success as unlikely, using __builtin_expect() intrinsic
Diffstat (limited to 'sha256_cryptopp.c')
-rw-r--r-- | sha256_cryptopp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sha256_cryptopp.c b/sha256_cryptopp.c index eed3a52..a954a85 100644 --- a/sha256_cryptopp.c +++ b/sha256_cryptopp.c @@ -110,7 +110,7 @@ bool scanhash_cryptopp(const unsigned char *midstate, unsigned char *data, stat_ctr++; - if ((hash32[7] == 0) && fulltest(hash, target)) { + if (unlikely((hash32[7] == 0) && fulltest(hash, target))) { *hashes_done = stat_ctr; return true; } @@ -592,7 +592,7 @@ bool scanhash_asm32(const unsigned char *midstate, unsigned char *data, stat_ctr++; - if ((hash32[7] == 0) && fulltest(hash, target)) { + if (unlikely((hash32[7] == 0) && fulltest(hash, target))) { fulltest(hash, target); *hashes_done = stat_ctr; |