yaptv/YapDatabase — pull request #2 by chaitanyapandit (2013-05-11 19:55:08+00:00)
Title: [Bugfix] Reverse enumeration issues with range spanning in to multiple pages

Say I have a ordered collection with keys 0 to 105

I reverse enumerating through a collection using enumerateKeysInRange:withOptions:...
With NSEnumerationReverse and range (95,0)

I would get this:

Key 199,
Key 198,
Key 197,
Key 196,
Key 195,
Key 4,
Key 3,
Key 2,
Key 1,
Key 0,

The pageOffset wasn't getting computed when transitioning between pages, also for above if I use NSEnumerationConcurrent, I'd get the following error:

enumerateKeysInRange:withOptions:usingBlock:transaction:: Range out of bounds: range(95, 10) >= numberOfKeys(206)