Stupid sort

Simple sorting algorithm, but effective only for very small arrays. Complexity 
Array.prototype.stupidSort = function (f) {
    f = f || function (x, y) {
        return x - y;
    };
    var t = this,
        i = 0,
        n = t.length - 1;
    while (i < n) {
        if (f(t[i + 1], t[i]) > 0) {
            var a = t[i]
            t[i] = t[i + 1];
            t[i + 1] = a;
            i = 0;
        } else {
            i++;
        }
    }
}