Skip to content

Commit a99a736

Browse files
committed
Use OrderedCollections
Closes #392
1 parent bdd7aa0 commit a99a736

File tree

5 files changed

+6
-557
lines changed

5 files changed

+6
-557
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.12.0"
44

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

89
[extras]
910
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/DataStructures.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ module DataStructures
1616
eachindex, keytype, valtype
1717
import Base: iterate
1818

19-
using InteractiveUtils: methodswith
19+
using OrderedCollections
20+
using OrderedCollections: rehash!
21+
import OrderedCollections: filter, filter!, isordered
2022

2123
export complement, complement!
2224

@@ -67,10 +69,8 @@ module DataStructures
6769
include("disjoint_set.jl")
6870
include("heaps.jl")
6971

70-
include("dict_support.jl")
71-
include("ordered_dict.jl")
72-
include("ordered_set.jl")
7372
include("default_dict.jl")
73+
include("dict_support.jl")
7474
include("trie.jl")
7575

7676
include("int_set.jl")

src/dict_support.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# support functions
22

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

85
function not_iterator_of_pairs(kv)
96
return any(x->isempty(methodswith(typeof(kv), x, true)),

0 commit comments

Comments
 (0)