Why? The points_ array is already sorted, so I think binarySelect is
costless.


On 29 January 2013 17:34, Tom Payne <notifications@github.com> wrote:

> In src/ol/kinetic.js:
>
> > + */
> > +ol.Kinetic.prototype.update = function(browserEvent) {
> > +  this.points_.push({
> > +    x: browserEvent.clientX,
> > +    y: browserEvent.clientY,
> > +    t: goog.now()
> > +  });
> > +};
> > +
> > +
> > +/**
> > + * @return {boolean} Whether we should do kinetic animation.
> > + */
> > +ol.Kinetic.prototype.end = function() {
> > +  var now = goog.now();
> > +  var index = Math.abs(goog.array.binarySelect(this.points_, function(elt) {
>
> Linear search will probably be (in practice) faster here.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/openlayers/ol3/pull/164/files#r2811177>.
>
>