• Post Reply Bookmark Topic Watch Topic
  • New Topic

did i wrote this "find member" method correctly??  RSS feed

 
alex lotel
Ranch Hand
Posts: 191
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

Have you tried it? Does it run?

I haven't tried it, but just eyeballing it, the method "looks wrong."
You have multiple return statements from a single "for" loop.
Your for loop has no proper initialisation, only "head".
The double updating might be permissible syntax (and you can find it in the books) but it is confusing to read. In fact this looks quite inappropriate for a "for" loop.
And you should never have "==true" after "if."
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!