documentcloud/backbone — pull request #1311 by mattfenwick (2012-05-14 17:14:41+00:00)
Title: Tweak data structure for events

In `Backbone.Events`, the events in `_callbacks` are stored as an alternating list of callback and context, i.e.:

{myevent: [, , , , ...] ...}

Instead, it makes more sense to me if the callbacks are saved with their contexts, i.e.:

{myevent: [[, ],
[, ], ...] ...}

This also makes the `off` method simpler, since the repeated uses of `splice` can be replaced by a single `filter`, which is likely to be faster.