Advertisement
pro_cessor

Oh God Why

Sep 25th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.46 KB | None | 0 0
  1.     static member Compare (a:ByteString, b:ByteString) =
  2.         let x,o,l = a.Array, a.Offset, a.Count
  3.         let x',o',l' = b.Array, b.Offset, b.Count
  4.        if x = x' && o = o' && l = l' then 0
  5.         elif x = x' then
  6.            if o = o' then if l < l' then -1 else 1
  7.            else if o < o' then -1 else 1
  8.         else let left, right = x.[o..(o+l-1)], x'.[o'..(o'+l'-1)] in
  9.              if left = right then 0 elif left < right then -1 else 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement