Mailspring/spec/fixtures/coffee.coffee
Ben Gotow f8c5f7b967 refactor(db): change ID system to have clientIDs and serverIDs
Summary: Major ID refactor

Test Plan: edgehill --test

Reviewers: bengotow, dillon

Differential Revision: https://phab.nylas.com/D1946
2015-08-28 11:24:29 -07:00

23 lines
417 B
CoffeeScript

class Quicksort
sort: (items) ->
return items if items.length <= 1
pivot = items.shift()
left = []
right = []
# Comment in the middle
while items.length > 0
current = items.shift()
if current < pivot
left.push(current)
else
right.push(current);
sort(left).concat(pivot).concat(sort(right))
noop: ->
# just a noop
exports.modules = Quicksort