WardCunningham/Smallest-Federated-Wiki — pull request #254 by dtsato (2012-07-02 05:35:36+00:00)
Title: First attempt at refactoring revision.coffee

I've had a busy week wrapping up a client project and getting ready for an international trip, so didn't have as much time to work on this as I expected. This will I'll have more time to work on this if you have any feedback. I split the commits to make it easier for you to review:

* The first one adds unit tests to cover most of the scenarios the current code was handling. They were also based on some of your earlier comments about adds.

* The second is a simple refactoring to use comprehension syntax to avoid another nested level of if.

* The third commit uses Array.indexOf to handle the cases to avoid looping with breaks, and also gets rid of the guard variables.