Skip to content

Commit c483dcb

Browse files
committed
Use only hash storage.
1 parent 73378f9 commit c483dcb

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

plexus/src/graph/edge.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use arrayvec::ArrayVec;
22
use derivative::Derivative;
33
use fool::BoolExt as _;
4-
use slotmap::DefaultKey;
54
use std::borrow::Borrow;
65
use std::hash::{Hash, Hasher};
76
use std::mem;
@@ -11,7 +10,7 @@ use theon::{AsPosition, AsPositionMut};
1110

1211
use crate::entity::borrow::{Reborrow, ReborrowInto, ReborrowMut};
1312
use crate::entity::storage::prelude::*;
14-
use crate::entity::storage::{AsStorage, AsStorageMut, HashStorage, Key, SlotStorage};
13+
use crate::entity::storage::{AsStorage, AsStorageMut, DiiKeyer, HashStorage, Key};
1514
use crate::entity::view::{Bind, ClosedView, Orphan, Rebind, Unbind, View};
1615
use crate::entity::{Entity, Payload};
1716
use crate::graph::data::{Data, GraphData, Parametric};
@@ -1245,7 +1244,7 @@ where
12451244
G: GraphData,
12461245
{
12471246
type Key = EdgeKey;
1248-
type Storage = SlotStorage<Self>;
1247+
type Storage = HashStorage<Self, DiiKeyer>;
12491248
}
12501249

12511250
impl<G> Payload for Edge<G>
@@ -1265,10 +1264,10 @@ where
12651264

12661265
/// Edge key.
12671266
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
1268-
pub struct EdgeKey(DefaultKey);
1267+
pub struct EdgeKey(u64);
12691268

12701269
impl Key for EdgeKey {
1271-
type Inner = DefaultKey;
1270+
type Inner = u64;
12721271

12731272
fn from_inner(key: Self::Inner) -> Self {
12741273
EdgeKey(key)

plexus/src/graph/face.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use derivative::Derivative;
22
use fool::BoolExt as _;
3-
use slotmap::DefaultKey;
43
use smallvec::SmallVec;
54
use std::borrow::Borrow;
65
use std::cmp;
@@ -15,7 +14,7 @@ use typenum::U3;
1514

1615
use crate::entity::borrow::{Reborrow, ReborrowInto, ReborrowMut};
1716
use crate::entity::storage::prelude::*;
18-
use crate::entity::storage::{AsStorage, AsStorageMut, Key, SlotStorage};
17+
use crate::entity::storage::{AsStorage, AsStorageMut, DiiKeyer, HashStorage, Key};
1918
use crate::entity::traverse::{Adjacency, Breadth, Depth, Trace, TraceFirst, Traversal};
2019
use crate::entity::view::{Bind, ClosedView, Orphan, Rebind, Unbind, View};
2120
use crate::entity::{Entity, Payload};
@@ -78,7 +77,7 @@ where
7877
G: GraphData,
7978
{
8079
type Key = FaceKey;
81-
type Storage = SlotStorage<Self>;
80+
type Storage = HashStorage<Self, DiiKeyer>;
8281
}
8382

8483
impl<G> Payload for Face<G>
@@ -98,10 +97,10 @@ where
9897

9998
/// Face key.
10099
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
101-
pub struct FaceKey(DefaultKey);
100+
pub struct FaceKey(u64);
102101

103102
impl Key for FaceKey {
104-
type Inner = DefaultKey;
103+
type Inner = u64;
105104

106105
fn from_inner(key: Self::Inner) -> Self {
107106
FaceKey(key)

plexus/src/graph/vertex.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use derivative::Derivative;
22
use fool::BoolExt as _;
3-
use slotmap::DefaultKey;
43
use smallvec::SmallVec;
54
use std::borrow::Borrow;
65
use std::hash::{Hash, Hasher};
@@ -12,7 +11,7 @@ use theon::AsPosition;
1211
use crate::entity::borrow::{Reborrow, ReborrowInto, ReborrowMut};
1312
use crate::entity::dijkstra;
1413
use crate::entity::storage::prelude::*;
15-
use crate::entity::storage::{AsStorage, AsStorageMut, AsStorageOf, Key, SlotStorage};
14+
use crate::entity::storage::{AsStorage, AsStorageMut, AsStorageOf, DiiKeyer, HashStorage, Key};
1615
use crate::entity::traverse::{Adjacency, Breadth, Depth, Trace, TraceAny, TraceFirst, Traversal};
1716
use crate::entity::view::{Bind, ClosedView, Orphan, Rebind, Unbind, View};
1817
use crate::entity::{Entity, Payload};
@@ -61,7 +60,7 @@ where
6160
G: GraphData,
6261
{
6362
type Key = VertexKey;
64-
type Storage = SlotStorage<Self>;
63+
type Storage = HashStorage<Self, DiiKeyer>;
6564
}
6665

6766
impl<G> Payload for Vertex<G>
@@ -81,10 +80,10 @@ where
8180

8281
/// Vertex key.
8382
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
84-
pub struct VertexKey(DefaultKey);
83+
pub struct VertexKey(u64);
8584

8685
impl Key for VertexKey {
87-
type Inner = DefaultKey;
86+
type Inner = u64;
8887

8988
fn from_inner(key: Self::Inner) -> Self {
9089
VertexKey(key)

0 commit comments

Comments
 (0)