~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/d3/src/core/last.js

  • Committer: Evan Dandrea
  • Date: 2012-05-09 05:53:45 UTC
  • Revision ID: evan.dandrea@canonical.com-20120509055345-z2j41tmcbf4as5uf
The backend now lives in lp:daisy and the website (errors.ubuntu.com) now lives in lp:errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
d3.last = function(array, f) {
2
 
  var i = 0,
3
 
      n = array.length,
4
 
      a = array[0],
5
 
      b;
6
 
  if (arguments.length === 1) f = d3.ascending;
7
 
  while (++i < n) {
8
 
    if (f.call(array, a, b = array[i]) <= 0) {
9
 
      a = b;
10
 
    }
11
 
  }
12
 
  return a;
13
 
};