public int? GetValueA(int index) { try { return dataList[index]; } catch { return null; } } public int? GetValueB(int index) { if (0 <= index && index < dataList.Count) { return dataList[index]; } return null; }
A방식과 B방식중 어떤 스타일을 선호하시고 왜 그 방식을 선호 하시나요.? ㅎ
https://www.c-sharpcorner.com/blogs/impact-of-trycatch-on-performance
게임 프로그래머의 만담 커뮤니티, 게임코디 입니다
온종일 코드와 씨름하는 우리들의 외로움을 삭이고자 합니다