Skip to content

Simplify HashUtil method when possible#12307

Closed
Arthur-Milchior wants to merge 2 commits into
ankidroid:mainfrom
Arthur-Milchior:capacity
Closed

Simplify HashUtil method when possible#12307
Arthur-Milchior wants to merge 2 commits into
ankidroid:mainfrom
Arthur-Milchior:capacity

Conversation

@Arthur-Milchior

Copy link
Copy Markdown
Member

Now that HashUtil methods are not used in Java anymore (at least once #12301 is merged. But my two commits can be reviewed independently of #12301), I can make them return Kotlin type instead of java type. This ensure better typing as far as nullability goes.

Working on them, I also cleaned every usage of those methods that can be replaced by map/associate/filter.

I believe this PR should be rebased

@david-allison

Copy link
Copy Markdown
Member

Needs a rebase to remove the Sound changes

@Arthur-Milchior Arthur-Milchior changed the title Capacity Simplify HashUtil method when possible Sep 4, 2022
@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Sep 4, 2022
@lukstbit

lukstbit commented Sep 4, 2022

Copy link
Copy Markdown
Member

@Arthur-Milchior Build failure:

e: /Users/runner/work/Anki-Android/Anki-Android/AnkiDroid/src/main/java/com/ichi2/libanki/sched/Sched.kt: (162, 20): Unresolved reference: HashUtil

* Move out of object.
* transform as an expression
* uses coerceAtLeast as suggested by IDE
* Generalize some value it returns to Kotlin interface instead of specific kind
  of set/map
The function generate set and map from collections already deals with doing
proper size allocation.
@github-actions

Copy link
Copy Markdown
Contributor

Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions Bot added the Stale label Nov 18, 2022
@github-actions github-actions Bot closed this Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants