Skip to content

Commit fcc6d17

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

7 files changed

+9
-584
lines changed

Project.toml

Lines changed: 4 additions & 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"
@@ -13,3 +14,6 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1314

1415
[targets]
1516
test = ["Test", "Primes", "Random", "Serialization"]
17+
18+
[compat]
19+
OrderedCollections = "1.0.1"

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
julia 0.7
2+
OrderedCollections 1.0.1

src/DataStructures.jl

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

19-
using InteractiveUtils: methodswith
19+
using OrderedCollections
20+
import OrderedCollections: filter, filter!, isordered
2021

2122
export complement, complement!
2223

@@ -67,10 +68,8 @@ module DataStructures
6768
include("disjoint_set.jl")
6869
include("heaps.jl")
6970

70-
include("dict_support.jl")
71-
include("ordered_dict.jl")
72-
include("ordered_set.jl")
7371
include("default_dict.jl")
72+
include("dict_support.jl")
7473
include("trie.jl")
7574

7675
include("int_set.jl")
@@ -88,8 +87,6 @@ module DataStructures
8887
include("tokens2.jl")
8988
include("container_loops.jl")
9089

91-
include("dict_sorting.jl")
92-
9390
export
9491
CircularBuffer,
9592
capacity,

src/dict_sorting.jl

Lines changed: 0 additions & 25 deletions
This file was deleted.

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)