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

Fixed size oracle #523

Merged
merged 2 commits into from Feb 6, 2019
Merged

Fixed size oracle #523

merged 2 commits into from Feb 6, 2019

Conversation

@gavraz
Copy link
Contributor

@gavraz gavraz commented Feb 6, 2019

Added package with the fixed size oracle


func cloneMap(m map[string]struct{}) map[string]struct{} {
c := make(map[string]struct{}, len(m))
for k, v := range m {

This comment has been minimized.

@antonlerner

antonlerner Feb 6, 2019
Member

you iterate a map without locking it

This comment has been minimized.

@gavraz

gavraz Feb 6, 2019
Author Contributor

cloneMap is private and not thread-safe. We never call this function without enforcing safety.


func pickUnique(pickCount int, orig map[string]struct{}, dest map[string]struct{}) {
i := 0
for k := range orig { // randomly pass on clients

This comment has been minimized.

@antonlerner

antonlerner Feb 6, 2019
Member

map is not locked

This comment has been minimized.

@gavraz

gavraz Feb 6, 2019
Author Contributor

pickUnique is private and not thread-safe. We never call this function without enforcing safety.

@gavraz gavraz merged commit 06ab4e2 into develop Feb 6, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@y0sher y0sher deleted the fixed_oracle_package branch Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants