소스 검색

Make the dfs const

More safe
DricomDragon 5 년 전
부모
커밋
b9ac61d604
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      main.cc

+ 1 - 1
main.cc

@@ -153,7 +153,7 @@ class World
 		// starting from tile number s0, find a path to tile number t
 		// return true if such a path exists, false otherwise
 		// if it exists the path is given in variable path (hence the reference &)
-		bool dfs(unsigned int s0, unsigned int target, list<unsigned int>& path, list<unsigned int>& discovered)
+		const bool dfs(unsigned int s0, unsigned int target, list<unsigned int>& path, list<unsigned int>& discovered)
 		{
 			bool r = false;