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

Conversation

Projects
None yet
2 participants
@gavraz
Copy link
Contributor

gavraz commented Feb 6, 2019

Added package with the fixed size oracle

gavraz added some commits Feb 6, 2019


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

Collaborator

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

Collaborator

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

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment