-1
嗨,哪種語法更好?它們是否相同?Is if(someObject == null){continue; }比if(someObject!= null){then do; }?
if (someObject == null) { continue; }
或
if (someObject != null) { then do; }
嗨,哪種語法更好?它們是否相同?Is if(someObject == null){continue; }比if(someObject!= null){then do; }?
if (someObject == null) { continue; }
或
if (someObject != null) { then do; }
我通常寧願早迴歸分析法(或continue
年初,在你的例子),因爲它讓我單獨拿出我的看家(空檢查,論證有效性檢查等)從我的核心邏輯。