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

amount and halve implementation for Dict and DictView is wrong #1

Open
MasonProtter opened this issue Jan 27, 2024 · 1 comment
Open

Comments

@MasonProtter
Copy link
Member

This seems to assume some maybe bad things about Dict.

e.g.

julia> using SplittablesBase: amount, halve

julia> d = Dict(:a =>"one", :b=>"two", :c=>"three", :d=>"four", :e=>"five");

julia> l, r = halve(d);

julia> amount(d), length(d)
(16, 5)

julia> amount(l), length(l)
(8, 4)

julia> amount(r), length(r)
(8, 1)
@longemen3000
Copy link

i think you can get a better estimate by just using d.count ÷ 2 instead of doing what is being done right now (but it would be still different to length)

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

No branches or pull requests

2 participants