Skip to content

Instantly share code, notes, and snippets.

@Synesso
Forked from dcbriccetti/IsTooComplex.scala
Created August 30, 2009 07:55
Show Gist options
  • Save Synesso/177901 to your computer and use it in GitHub Desktop.
Save Synesso/177901 to your computer and use it in GitHub Desktop.
val matches = (utm.friends ::: utm.followers).map(u => NameAndScreenName(u.name, u.screenName)).filter(_.matches(searchText.text)).sort((e1, e2) => (e1 compareTo e2) < 0).removeDuplicates
(matches.length match {
case 0 => "No matches were found"
case 1 => "Select the following item to insert a @screenname"
case _ => "Select one of these " + matches.length + " items to insert a @screenname"
}) :: matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment