mneorr/ObjectiveSugar — pull request #40 by kastiglione (2013-10-06 18:46:48+00:00)
Title: Uniform sample

A couple fixes. First, uses `arc4random_uniform`. Second, handles sampling of empty arrays and sets by returning `nil`, as the header docs suggest it should.

From the `arc4random` man page:

```
arc4random_uniform() will return a uniformly distributed random number less than
upper_bound. arc4random_uniform() is recommended over constructions like
``arc4random() % upper_bound'' as it avoids "modulo bias" when the upper bound is not
a power of two.
```