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

use unique identifier for character pickers #1344

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

70ray
Copy link
Collaborator

@70ray 70ray commented Oct 1, 2024

This addresses issue #1334.
The problem was that an identifier is used to link the selector button with the appropriate picker set. This was based on the contents of the selector button which was the same for the two greek sets. Any unique identifier would serve. There are some issues with uniquid() but it appears that it sleeps for a microsecond at each invocation so it works for our purpose. A serial number would also work.

Sandbox at: https://www.pgdp.org/~rp31/c.branch/uniq_picker

@70ray 70ray requested review from cpeel and srjfoo October 1, 2024 15:26
@@ -33,10 +34,11 @@ class CharacterSelector
}

foreach ($picker_set->get_subsets() as $code => $picker) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe a regular for loop would be more appropriate now that we are managing a counter variable.

Copy link
Member

Choose a reason for hiding this comment

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

I think a foreach is still the right loop type because its iterating over a dictionary -- not an integer-indexed array. If PHP had enumerate() like python I'd say use that but it doesn't.

@cpeel cpeel merged commit e725f76 into DistributedProofreaders:master Oct 3, 2024
12 checks passed
@70ray 70ray deleted the uniq_picker branch October 10, 2024 10:59
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.

4 participants