mirror of
https://github.com/KevinWG/OSS.Common.git
synced 2026-10-24 10:20:00 +08:00
去除异常方法
This commit is contained in:
@@ -70,7 +70,7 @@ namespace OSS.Common
|
||||
/// </summary>
|
||||
protected int TimestampLeftShift { get; private set; }
|
||||
|
||||
private void InitailConfig(int seqBitLength, int worIdBitLength)
|
||||
private void InitialConfig(int seqBitLength, int worIdBitLength)
|
||||
{
|
||||
_sequenceBitLength = seqBitLength;
|
||||
_maxSequence = -1L ^ (-1L << _sequenceBitLength);
|
||||
@@ -97,7 +97,7 @@ namespace OSS.Common
|
||||
/// </summary>
|
||||
protected BaseNumGenerator(int workId, int seqBitLength, int worIdBitLength)
|
||||
{
|
||||
InitailConfig(seqBitLength, worIdBitLength);
|
||||
InitialConfig(seqBitLength, worIdBitLength);
|
||||
|
||||
if (workId > _maxWorkerId || workId < 0)
|
||||
{
|
||||
@@ -128,6 +128,7 @@ namespace OSS.Common
|
||||
/// </summary>
|
||||
/// <param name="milliseconds"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete]
|
||||
public (long min, long max) GetNumRange(long milliseconds)
|
||||
{
|
||||
var min = CombineNum(milliseconds, 0);
|
||||
@@ -143,9 +144,7 @@ namespace OSS.Common
|
||||
/// <returns></returns>
|
||||
private long CombineNum(long timestamp, long sequence)
|
||||
{
|
||||
return (timestamp << TimestampLeftShift)
|
||||
| (WorkId << WorkerLeftShift)
|
||||
| sequence;
|
||||
return (timestamp << TimestampLeftShift) | (WorkId << WorkerLeftShift) | sequence;
|
||||
}
|
||||
|
||||
private void SetTimestampAndSeq()
|
||||
|
||||
Reference in New Issue
Block a user