Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed memoization of RankedModel::Ranker::Mapper#finder #110

Closed
wants to merge 1 commit into from

Conversation

jmchambers
Copy link

Fixed memoization of RankedModel::Ranker::Mapper#finder; it now caches a value for each passed sort order; without this multiple calls to finder can cause weird flipping issues where whole list gets reversed.

May be related to issue mentioned here: #103

…s a value for each passed sort order; without this multiple calls to finder can cause weird flipping issues where whole list gets reversed
mpokrywka added a commit to mpokrywka/ranked-model that referenced this pull request Sep 7, 2016
@mpokrywka
Copy link

When updating position using ":up", "update_index_from_position" calls "find_previous_two" which calls "finder" with ":desc" parameter - and causes finder to be memoized with descending order which causes problems when rebalance is called when saving. This should fix #103, I added test 37e19f8 which demonstrates problem (moving up and rebalance because positions are consecutive without gaps) and is fixed by this PR

@brendon
Copy link
Owner

brendon commented Oct 18, 2018

This has now been fixed by #103

@brendon brendon closed this Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants