Programming Tutorial: Comments
Comments are only effective if they threaten abuse.
/**
* Note: The following array MUST be sorted in order for BinarySearch to work. I have taken the liberty of
* creating it sorted to avoid this operation. If you really feel the need to break the manual sorting,
* uncomment the array.sort below this, and then go out and stand in front of traffic. thank you.
*/
string[] allowed_items = {"activate", "restore", "save", "update-relay", "verify-mount", "verify-restore"};
//Array.Sort(allowed_items);
if (Array.BinarySearch(allowed_items, list) >= 0) {
/* -.v.- */
}
Discovered by Noah Massey.
Leave a Reply
You must be logged in to post a comment.