유니티 튜토리얼 프로젝트를 진행하던 도중 코드에서 쓰이는 var이 신경쓰여서 찾아보았습니다.
자동으로 들어오는 값의 타입으로 바꿔준다는 것만 알고 있었는데, 과연 성능적으로 더 좋은 건지 의문이 들기도 하고 한 번 알아두고 가는 것도 나쁘지 않겠죠.
LinkedList<SomeTpe> List;
for(var n=list.first;n!=null;n=n.next)
참고
https://answers.unity.com/questions/1087276/why-woud-i-use-var-in-c.html
https://forum.unity.com/threads/is-using-var-instead-of-specific-types-really-ok.934611/
https://whyprogrammer.tistory.com/241