Discuss / 编程 / IdUtil源码里的疑问

IdUtil源码里的疑问

Topic source

和36224

#1 Created at ... [Delete] [Delete and Lock User]

以下是IdUtil源码里边的几行代码,为什么是n < 8,跟8有什么关系 

if (matcher.matches()) {

long n = Long.parseLong(matcher.group(1));

if (n >= 0 && n < 8) {

logger.info("detect server id from host name {}: {}.", hostname, n);

return n;

}

}

同问,为什么是8,而不是31


  • 1

Reply