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

Refactor Popular Logic (again) #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Electrosolt
Copy link

Modifiy the span during which popular suggestions affect the requirement, and change the maximum from 23 to a bot constant (35).

Modifiy the span during which popular suggestions affect the requirement, and change the maximum from 23 to a bot constant (35).
@Electrosolt
Copy link
Author

Quick note, someone please look over the changes in case I made a mistake somewhere, as this is incredibly hard to test without 30+ alts and 2 weeks of time.

Comment on lines 19 to 24
ratio = BotConstants.MIN_RATIO + (int) set.getInt("recents")) ;
if (ratio < BotConstants.MIN_RATIO) {
ratio = BotConstants.MIN_RATIO;
}
if (ratio > BotConstants.MAX_RATIO) {
ratio = BotConstants.MAX_RATIO
Copy link
Contributor

@Owen1212055 Owen1212055 Aug 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do something like

Math.min(BotConstants.MIN_RATIO, Math.min(ratio, BotConstants.MAX_RATIO))

Small change to remove ifs
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.

3 participants