From c433f79504b67f08be11775079dd8468cfa1b699 Mon Sep 17 00:00:00 2001 From: zhouzj Date: Tue, 23 Mar 2021 01:53:11 +0800 Subject: [PATCH] auto commit --- C#.NET/source/Yitter.IdGenerator/DefaultIdGenerator.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/C#.NET/source/Yitter.IdGenerator/DefaultIdGenerator.cs b/C#.NET/source/Yitter.IdGenerator/DefaultIdGenerator.cs index f035919..56ff02a 100644 --- a/C#.NET/source/Yitter.IdGenerator/DefaultIdGenerator.cs +++ b/C#.NET/source/Yitter.IdGenerator/DefaultIdGenerator.cs @@ -40,15 +40,14 @@ namespace Yitter.IdGenerator throw new ApplicationException("BaseTime error."); } - if (options.SeqBitLength + options.WorkerIdBitLength > 22) - { - throw new ApplicationException("error:WorkerIdBitLength + SeqBitLength <= 22"); - } - if (options.WorkerIdBitLength <= 0) { throw new ApplicationException("WorkerIdBitLength error.(range:[1, 21])"); } + if (options.SeqBitLength + options.WorkerIdBitLength > 22) + { + throw new ApplicationException("error:WorkerIdBitLength + SeqBitLength <= 22"); + } var maxWorkerIdNumber = Math.Pow(2, options.WorkerIdBitLength) - 1; if (options.WorkerId < 0 || options.WorkerId > maxWorkerIdNumber)