If not present then return
if ( pCrawl . children [ index ] == null ) return ; pCrawl = pCrawl . children [ index ] ; } foreach ( int i in pCrawl . pos ) { if ( i == id ) continue ; List < int > l = new List < int > ( ) ; l . Add ( id ) ; l . Add ( i ) ; result . Add ( l ) ; } }