1
0
mirror of synced 2026-02-05 04:27:55 +08:00

auto commit

This commit is contained in:
yitter
2025-04-10 13:37:49 +08:00
parent b355947388
commit 942ba6adcb
3 changed files with 3 additions and 3 deletions

View File

@@ -213,7 +213,7 @@ namespace idgen
int64_t CalcTurnBackId()
{
uint64_t result = (_SnowFlakeWorker._LastTimeTick << _SnowFlakeWorker._TimestampShift) | (_SnowFlakeWorker.WorkerId << _SnowFlakeWorker.SeqBitLength) |
uint64_t result = (_SnowFlakeWorker._TurnBackTimeTick << _SnowFlakeWorker._TimestampShift) | (_SnowFlakeWorker.WorkerId << _SnowFlakeWorker.SeqBitLength) |
(_SnowFlakeWorker._TurnBackIndex);
_SnowFlakeWorker._TurnBackTimeTick--;
return result;

View File

@@ -112,7 +112,7 @@ static inline int64_t CalcId(SnowFlakeWorker *worker) {
}
static inline int64_t CalcTurnBackId(SnowFlakeWorker *worker) {
uint64_t result = (worker->_LastTimeTick << worker->_TimestampShift) | (worker->WorkerId << worker->SeqBitLength) |
uint64_t result = (worker->_TurnBackTimeTick << worker->_TimestampShift) | (worker->WorkerId << worker->SeqBitLength) |
(worker->_TurnBackIndex);
worker->_TurnBackTimeTick--;
return result;

View File

@@ -261,7 +261,7 @@ static inline uint64_t CalcId(snowflake *flake)
static inline uint64_t CalcTurnBackId(snowflake *flake)
{
uint64_t result = (flake->_LastTimeTick << flake->_TimestampShift) + (flake->WorkerId << flake->SeqBitLength) + (flake->_TurnBackIndex );
uint64_t result = (flake->_TurnBackTimeTick << flake->_TimestampShift) + (flake->WorkerId << flake->SeqBitLength) + (flake->_TurnBackIndex );
flake->_TurnBackTimeTick--;
return result;
}