Removed offset adjustment from limit calculation #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The number of result items should be capped to the item limit (either
the total number of items reported by the json or to some arbitrary max
value). Subtracting the offset value from that limit would effectively
cap the results early once the offset exceeded the number of results
retrieved.
Ex. Retrieving 60 total items with a 50 item limit and no max cap:
Old effective cap is (60-0) 50, new effective cap is 50. We retrieve
and add all 50 items to the results. Let's increase the offset and
retrieve the next batch.
Old effective cap is (60-50) 10, new effective cap is still 50. With
the old effective cap we simply stop and return the 50 items we had
already retrieved. With the new effective cap we retrieve and add all
10 items to the results, then return with the full 60 results.