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.

This entry was written by MET , posted on Friday March 27 2009at 06:03 pm , filed under humor, programming and tagged , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

You must be logged in to post a comment.