Skip to content

Commit

Permalink
Make code clearer by adding a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kaBeech committed Aug 14, 2024
1 parent 1835462 commit efa97d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Data/Tensort/Robustsort.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,10 @@ getLn x = ceiling (log (fromIntegral x) :: Double)

robustsortRecursive :: Int -> SortAlg -> SortAlg
robustsortRecursive bytesize baseSortAlg
| bytesize <= 528491359 = tensort (mkTsProps (getLn bytesize) (baseSortAlg))
-- ln (ln (528491359)) ~= 3
-- So this is saying, if we have a bitesize of 528,491,359 or less, use
-- one more iteration of Tensort to sort the records. This last iteration
-- will use the baseSortAlg (which by default is a standard version of
-- Robustsort with a bytesize of 3) to sort its records.
| bytesize <= 528491359 = tensort (mkTsProps (getLn bytesize) baseSortAlg)
| otherwise = tensort (mkTsProps (getLn bytesize) (robustsortRecursive (getLn bytesize) baseSortAlg))

0 comments on commit efa97d3

Please sign in to comment.