Skip to content

Commit

Permalink
Use only hash storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
olson-sean-k committed Dec 9, 2020
1 parent 73378f9 commit c483dcb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
9 changes: 4 additions & 5 deletions plexus/src/graph/edge.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use arrayvec::ArrayVec;
use derivative::Derivative;
use fool::BoolExt as _;
use slotmap::DefaultKey;
use std::borrow::Borrow;
use std::hash::{Hash, Hasher};
use std::mem;
Expand All @@ -11,7 +10,7 @@ use theon::{AsPosition, AsPositionMut};

use crate::entity::borrow::{Reborrow, ReborrowInto, ReborrowMut};
use crate::entity::storage::prelude::*;
use crate::entity::storage::{AsStorage, AsStorageMut, HashStorage, Key, SlotStorage};
use crate::entity::storage::{AsStorage, AsStorageMut, DiiKeyer, HashStorage, Key};
use crate::entity::view::{Bind, ClosedView, Orphan, Rebind, Unbind, View};
use crate::entity::{Entity, Payload};
use crate::graph::data::{Data, GraphData, Parametric};
Expand Down Expand Up @@ -1245,7 +1244,7 @@ where
G: GraphData,
{
type Key = EdgeKey;
type Storage = SlotStorage<Self>;
type Storage = HashStorage<Self, DiiKeyer>;
}

impl<G> Payload for Edge<G>
Expand All @@ -1265,10 +1264,10 @@ where

/// Edge key.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct EdgeKey(DefaultKey);
pub struct EdgeKey(u64);

impl Key for EdgeKey {
type Inner = DefaultKey;
type Inner = u64;

fn from_inner(key: Self::Inner) -> Self {
EdgeKey(key)
Expand Down
9 changes: 4 additions & 5 deletions plexus/src/graph/face.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use derivative::Derivative;
use fool::BoolExt as _;
use slotmap::DefaultKey;
use smallvec::SmallVec;
use std::borrow::Borrow;
use std::cmp;
Expand All @@ -15,7 +14,7 @@ use typenum::U3;

use crate::entity::borrow::{Reborrow, ReborrowInto, ReborrowMut};
use crate::entity::storage::prelude::*;
use crate::entity::storage::{AsStorage, AsStorageMut, Key, SlotStorage};
use crate::entity::storage::{AsStorage, AsStorageMut, DiiKeyer, HashStorage, Key};
use crate::entity::traverse::{Adjacency, Breadth, Depth, Trace, TraceFirst, Traversal};
use crate::entity::view::{Bind, ClosedView, Orphan, Rebind, Unbind, View};
use crate::entity::{Entity, Payload};
Expand Down Expand Up @@ -78,7 +77,7 @@ where
G: GraphData,
{
type Key = FaceKey;
type Storage = SlotStorage<Self>;
type Storage = HashStorage<Self, DiiKeyer>;
}

impl<G> Payload for Face<G>
Expand All @@ -98,10 +97,10 @@ where

/// Face key.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct FaceKey(DefaultKey);
pub struct FaceKey(u64);

impl Key for FaceKey {
type Inner = DefaultKey;
type Inner = u64;

fn from_inner(key: Self::Inner) -> Self {
FaceKey(key)
Expand Down
9 changes: 4 additions & 5 deletions plexus/src/graph/vertex.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use derivative::Derivative;
use fool::BoolExt as _;
use slotmap::DefaultKey;
use smallvec::SmallVec;
use std::borrow::Borrow;
use std::hash::{Hash, Hasher};
Expand All @@ -12,7 +11,7 @@ use theon::AsPosition;
use crate::entity::borrow::{Reborrow, ReborrowInto, ReborrowMut};
use crate::entity::dijkstra;
use crate::entity::storage::prelude::*;
use crate::entity::storage::{AsStorage, AsStorageMut, AsStorageOf, Key, SlotStorage};
use crate::entity::storage::{AsStorage, AsStorageMut, AsStorageOf, DiiKeyer, HashStorage, Key};
use crate::entity::traverse::{Adjacency, Breadth, Depth, Trace, TraceAny, TraceFirst, Traversal};
use crate::entity::view::{Bind, ClosedView, Orphan, Rebind, Unbind, View};
use crate::entity::{Entity, Payload};
Expand Down Expand Up @@ -61,7 +60,7 @@ where
G: GraphData,
{
type Key = VertexKey;
type Storage = SlotStorage<Self>;
type Storage = HashStorage<Self, DiiKeyer>;
}

impl<G> Payload for Vertex<G>
Expand All @@ -81,10 +80,10 @@ where

/// Vertex key.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct VertexKey(DefaultKey);
pub struct VertexKey(u64);

impl Key for VertexKey {
type Inner = DefaultKey;
type Inner = u64;

fn from_inner(key: Self::Inner) -> Self {
VertexKey(key)
Expand Down

0 comments on commit c483dcb

Please sign in to comment.