change: 精简多余的判断.
This commit is contained in:
@@ -73,8 +73,7 @@ public final class BreakageUnidirectionalStateManager<S> extends DefaultUnidirec
|
|||||||
/*
|
/*
|
||||||
* 非最后一个状态且切换后的状态必须在当前状态的下位
|
* 非最后一个状态且切换后的状态必须在当前状态的下位
|
||||||
*/
|
*/
|
||||||
if (isLast() ||
|
if (indexOf(state) <= currentIndex()) {
|
||||||
indexOf(state) <= currentIndex()) {
|
|
||||||
if (allowThrow)
|
if (allowThrow)
|
||||||
throw new StateException("The last state has been reached and cannot be switched again!");
|
throw new StateException("The last state has been reached and cannot be switched again!");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user