Skip to content

fix: uncomment and fix CalculateTopRanks, optimize core functions#18

Open
lenisko wants to merge 1 commit intomasterfrom
len-fixes
Open

fix: uncomment and fix CalculateTopRanks, optimize core functions#18
lenisko wants to merge 1 commit intomasterfrom
len-fixes

Conversation

@lenisko
Copy link
Collaborator

@lenisko lenisko commented Feb 6, 2026

CalculateTopRanks:

  • Fix lastRank tracking: populate lastRank[i] so duplicate detection works across level caps
  • Fix Capped mutation: use index-based tracking (lastRankIdx) to modify rankings directly instead of local copies
  • Pass comparator to calculateRanksCompact; pass stats as pointer
  • Replace O(n²) Capped propagation with O(n) index lookup

Optimizations:

  • Simplify RankingComparatorPreferHigherCp/PreferLowerCp with early return
  • Replace reflect.DeepEqual with sha256 hash comparison in WatchPokemonData

Cleanup:

  • Remove "Current State" section from README
  • Remove commented-out CalculateAllRanks test/benchmark

CalculateTopRanks:
- Fix lastRank tracking: populate lastRank[i] so duplicate detection works across level caps
- Fix Capped mutation: use index-based tracking (lastRankIdx) to modify rankings directly instead of local copies
- Pass comparator to calculateRanksCompact; pass stats as pointer
- Replace O(n²) Capped propagation with O(n) index lookup

Optimizations:
- Simplify RankingComparatorPreferHigherCp/PreferLowerCp with early return
- Replace reflect.DeepEqual with sha256 hash comparison in WatchPokemonData

Cleanup:
- Remove "Current State" section from README
- Remove commented-out CalculateAllRanks test/benchmark
@lenisko lenisko requested a review from Mygod February 6, 2026 01:55
@jfberry
Copy link
Contributor

jfberry commented Feb 7, 2026

Do the masterfile changes align with the PR for golbat to combine the masterfiles?
I'd really like there to be one lol ;-)

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.

2 participants