调整锁位置和 不必要的int拆箱

This commit is contained in:
handy
2023-05-09 13:48:56 +08:00
parent 2fd1d5db70
commit 9dadfed42e
3 changed files with 6 additions and 9 deletions

View File

@@ -144,8 +144,8 @@ public abstract class ReentrantCache<K, V> extends AbstractCache<K, V> {
* @param withMissCount 是否计数丢失数
*/
private void remove(final K key, final boolean withMissCount) {
lock.lock();
CacheObj<K, V> co;
lock.lock();
try {
co = removeWithoutLock(key, withMissCount);
} finally {

View File

@@ -365,7 +365,7 @@ public class Ipv4Util implements Ipv4Pool {
* @return 掩码位,例如 24
* @throws IllegalArgumentException 子网掩码非法
*/
public static int getMaskBitByMask(final String mask) {
public static Integer getMaskBitByMask(final String mask) {
final Integer maskBit = MaskBit.getMaskBit(mask);
Assert.notNull(maskBit, "Invalid netmask{}", mask);
return maskBit;