作者 Awen

优化一些布尔判断语法

@@ -332,7 +332,7 @@ public final class HTMLFilter @@ -332,7 +332,7 @@ public final class HTMLFilter
332 final String name = m.group(1).toLowerCase(); 332 final String name = m.group(1).toLowerCase();
333 if (allowed(name)) 333 if (allowed(name))
334 { 334 {
335 - if (false == inArray(name, vSelfClosingTags)) 335 + if (!inArray(name, vSelfClosingTags))
336 { 336 {
337 if (vTagCounts.containsKey(name)) 337 if (vTagCounts.containsKey(name))
338 { 338 {
@@ -343,25 +343,25 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> @@ -343,25 +343,25 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
343 final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); 343 final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
344 // time_low 344 // time_low
345 builder.append(digits(mostSigBits >> 32, 8)); 345 builder.append(digits(mostSigBits >> 32, 8));
346 - if (false == isSimple) 346 + if (!isSimple)
347 { 347 {
348 builder.append('-'); 348 builder.append('-');
349 } 349 }
350 // time_mid 350 // time_mid
351 builder.append(digits(mostSigBits >> 16, 4)); 351 builder.append(digits(mostSigBits >> 16, 4));
352 - if (false == isSimple) 352 + if (!isSimple)
353 { 353 {
354 builder.append('-'); 354 builder.append('-');
355 } 355 }
356 // time_high_and_version 356 // time_high_and_version
357 builder.append(digits(mostSigBits, 4)); 357 builder.append(digits(mostSigBits, 4));
358 - if (false == isSimple) 358 + if (!isSimple)
359 { 359 {
360 builder.append('-'); 360 builder.append('-');
361 } 361 }
362 // variant_and_sequence 362 // variant_and_sequence
363 builder.append(digits(leastSigBits >> 48, 4)); 363 builder.append(digits(leastSigBits >> 48, 4));
364 - if (false == isSimple) 364 + if (!isSimple)
365 { 365 {
366 builder.append('-'); 366 builder.append('-');
367 } 367 }
@@ -140,7 +140,7 @@ public class SysDeptServiceImpl implements ISysDeptService @@ -140,7 +140,7 @@ public class SysDeptServiceImpl implements ISysDeptService
140 public boolean hasChildByDeptId(Long deptId) 140 public boolean hasChildByDeptId(Long deptId)
141 { 141 {
142 int result = deptMapper.hasChildByDeptId(deptId); 142 int result = deptMapper.hasChildByDeptId(deptId);
143 - return result > 0 ? true : false; 143 + return result > 0;
144 } 144 }
145 145
146 /** 146 /**
@@ -153,7 +153,7 @@ public class SysDeptServiceImpl implements ISysDeptService @@ -153,7 +153,7 @@ public class SysDeptServiceImpl implements ISysDeptService
153 public boolean checkDeptExistUser(Long deptId) 153 public boolean checkDeptExistUser(Long deptId)
154 { 154 {
155 int result = deptMapper.checkDeptExistUser(deptId); 155 int result = deptMapper.checkDeptExistUser(deptId);
156 - return result > 0 ? true : false; 156 + return result > 0;
157 } 157 }
158 158
159 /** 159 /**
@@ -325,6 +325,6 @@ public class SysDeptServiceImpl implements ISysDeptService @@ -325,6 +325,6 @@ public class SysDeptServiceImpl implements ISysDeptService
325 */ 325 */
326 private boolean hasChild(List<SysDept> list, SysDept t) 326 private boolean hasChild(List<SysDept> list, SysDept t)
327 { 327 {
328 - return getChildList(list, t).size() > 0 ? true : false; 328 + return getChildList(list, t).size() > 0;
329 } 329 }
330 } 330 }