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

Rebase on OrderedCollections #448

Merged
merged 2 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.12.0"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"

Copy link
Member

@oxinabox oxinabox Sep 19, 2018

Choose a reason for hiding this comment

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

Do we want to set a [compat] here?
It might make things more orthogonal.
Or it might not

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's necessary, since the latest tagged version of OrderedCollections works here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since I was making other changes, I added the compat

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand All @@ -13,3 +14,6 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[targets]
test = ["Test", "Primes", "Random", "Serialization"]

[compat]
OrderedCollections = "1.0.1"
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
julia 0.7
OrderedCollections 1.0.1
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we just get rid of this file now?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, I checked this morning.
Attobot won't talk to you if you don't have a REQUIRE file.

9 changes: 3 additions & 6 deletions src/DataStructures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module DataStructures
eachindex, keytype, valtype
import Base: iterate

using InteractiveUtils: methodswith
using OrderedCollections
import OrderedCollections: filter, filter!, isordered

export complement, complement!

Expand Down Expand Up @@ -67,10 +68,8 @@ module DataStructures
include("disjoint_set.jl")
include("heaps.jl")

include("dict_support.jl")
include("ordered_dict.jl")
include("ordered_set.jl")
include("default_dict.jl")
include("dict_support.jl")
include("trie.jl")

include("int_set.jl")
Expand All @@ -88,8 +87,6 @@ module DataStructures
include("tokens2.jl")
include("container_loops.jl")

include("dict_sorting.jl")

export
CircularBuffer,
capacity,
Expand Down
25 changes: 0 additions & 25 deletions src/dict_sorting.jl

This file was deleted.

5 changes: 1 addition & 4 deletions src/dict_support.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# support functions

# _tablesz and hashindex are defined in Base, but are not exported,
# so they are redefined here.
_tablesz(x::Integer) = x < 16 ? 16 : one(x)<<((sizeof(x)<<3)-leading_zeros(x-1))
hashindex(key, sz) = (reinterpret(Int,(hash(key))) & (sz-1)) + 1
using InteractiveUtils: methodswith

function not_iterator_of_pairs(kv)
return any(x->isempty(methodswith(typeof(kv), x, true)),
Expand Down
Loading