mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.5.5
This commit is contained in:
@@ -29,11 +29,18 @@
|
||||
static __thread uint32_t s_ntime = UINT32_MAX;
|
||||
static __thread int permutation[HASH_FUNC_COUNT] = { 0 };
|
||||
|
||||
inline void tt_swap( int *a, int *b )
|
||||
{
|
||||
int c = *a;
|
||||
*a = *b;
|
||||
*b = c;
|
||||
}
|
||||
|
||||
inline void reverse( int *pbegin, int *pend )
|
||||
{
|
||||
while ( (pbegin != pend) && (pbegin != --pend) )
|
||||
{
|
||||
swap_vars( *pbegin, *pend );
|
||||
tt_swap( pbegin, pend );
|
||||
pbegin++;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +69,7 @@ static void next_permutation( int *pbegin, int *pend )
|
||||
|
||||
while ( !(*i < *--k) ) /* do nothing */ ;
|
||||
|
||||
swap_vars( *i, *k );
|
||||
tt_swap( i, k );
|
||||
reverse(j, pend);
|
||||
return; // true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user