Skip to content

Commit 978127b

Browse files
committed
tag backing vector methods with #[inline]
Not really needed, I assume, but why not.
1 parent 35f0e2a commit 978127b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/unify/backing_vec.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,37 @@ impl<K: UnifyKey> UnificationStore for InPlace<K> {
4444
type Value = K::Value;
4545
type Snapshot = sv::Snapshot;
4646

47+
#[inline]
4748
fn new() -> Self {
4849
InPlace { values: sv::SnapshotVec::new() }
4950
}
5051

52+
#[inline]
5153
fn start_snapshot(&mut self) -> Self::Snapshot {
5254
self.values.start_snapshot()
5355
}
5456

57+
#[inline]
5558
fn rollback_to(&mut self, snapshot: Self::Snapshot) {
5659
self.values.rollback_to(snapshot);
5760
}
5861

62+
#[inline]
5963
fn commit(&mut self, snapshot: Self::Snapshot) {
6064
self.values.commit(snapshot);
6165
}
6266

67+
#[inline]
6368
fn len(&self) -> usize {
6469
self.values.len()
6570
}
6671

72+
#[inline]
6773
fn push(&mut self, value: VarValue<Self::Key>) {
6874
self.values.push(value);
6975
}
7076

77+
#[inline]
7178
fn update<F>(&mut self, index: usize, op: F)
7279
where F: FnOnce(&mut VarValue<Self::Key>)
7380
{
@@ -106,29 +113,36 @@ impl<K: UnifyKey> UnificationStore for Persistent<K> {
106113
type Value = K::Value;
107114
type Snapshot = Self;
108115

116+
#[inline]
109117
fn new() -> Self {
110118
Persistent { values: DVec::new() }
111119
}
112120

121+
#[inline]
113122
fn start_snapshot(&mut self) -> Self::Snapshot {
114123
self.clone()
115124
}
116125

126+
#[inline]
117127
fn rollback_to(&mut self, snapshot: Self::Snapshot) {
118128
*self = snapshot;
119129
}
120130

131+
#[inline]
121132
fn commit(&mut self, _snapshot: Self::Snapshot) {
122133
}
123134

135+
#[inline]
124136
fn len(&self) -> usize {
125137
self.values.len()
126138
}
127139

140+
#[inline]
128141
fn push(&mut self, value: VarValue<Self::Key>) {
129142
self.values.push(value);
130143
}
131144

145+
#[inline]
132146
fn update<F>(&mut self, index: usize, op: F)
133147
where F: FnOnce(&mut VarValue<Self::Key>)
134148
{

0 commit comments

Comments
 (0)