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

NF: Use enum for flag everywhere possible #17434

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Arthur-Milchior
Copy link
Member

It should be added that there is some ambiguity for the value of the flag. A flag could be either between 0 and 7, or an arbitrary int whose first 3 digits are the displayed flags.

Actually, the only time a number greater than 7 is generated, it's stored into the card's flags field, and never leave this object. So it's okay to use Flag object everywhere else.

AnkiDroid/src/main/java/com/ichi2/anki/Flag.kt Outdated Show resolved Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/Flag.kt Outdated Show resolved Hide resolved
AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt Outdated Show resolved Hide resolved
AnkiDroid/src/main/java/com/ichi2/libanki/Card.kt Outdated Show resolved Hide resolved
@BrayanDSO BrayanDSO added the Needs Author Reply Waiting for a reply from the original author label Nov 14, 2024
It should be added that there is some ambiguity for the value of the
flag. A flag could be either between 0 and 7, or an arbitrary int
whose first 3 digits are the displayed flags.

Actually, the only time a number greater than 7 is generated, it's
stored into the card's `flags` field, and never leave this object. So
it's okay to use `Flag` object everywhere else.
@BrayanDSO BrayanDSO added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Second Approval Has one approval, one more approval to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants