Skip to content

Commit e3ba95c

Browse files
committed
suggest inline.
1 parent e8808eb commit e3ba95c

File tree

1 file changed

+8
-0
lines changed
  • datafusion/functions-aggregate-common/src/aggregate/groups_accumulator

1 file changed

+8
-0
lines changed

datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/blocks.rs

+8
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub struct Blocks<B: Block> {
4444
}
4545

4646
impl<B: Block> Blocks<B> {
47+
#[inline]
4748
pub fn new(block_size: Option<usize>) -> Self {
4849
Self {
4950
inner: Vec::new(),
@@ -121,6 +122,7 @@ impl<B: Block> Blocks<B> {
121122
}
122123
}
123124

125+
#[inline]
124126
pub fn pop_block(&mut self) -> Option<B> {
125127
if self.next_emit_block_id >= self.inner.len() {
126128
return None;
@@ -133,18 +135,22 @@ impl<B: Block> Blocks<B> {
133135
Some(emit_blk)
134136
}
135137

138+
#[inline]
136139
pub fn len(&self) -> usize {
137140
self.inner.len()
138141
}
139142

143+
#[inline]
140144
pub fn is_empty(&self) -> bool {
141145
self.inner.is_empty()
142146
}
143147

148+
#[inline]
144149
pub fn iter(&self) -> impl Iterator<Item = &B> {
145150
self.inner.iter()
146151
}
147152

153+
#[inline]
148154
pub fn clear(&mut self) {
149155
self.inner.clear();
150156
self.next_emit_block_id = 0;
@@ -154,12 +160,14 @@ impl<B: Block> Blocks<B> {
154160
impl<B: Block> Index<usize> for Blocks<B> {
155161
type Output = B;
156162

163+
#[inline]
157164
fn index(&self, index: usize) -> &Self::Output {
158165
&self.inner[index]
159166
}
160167
}
161168

162169
impl<B: Block> IndexMut<usize> for Blocks<B> {
170+
#[inline]
163171
fn index_mut(&mut self, index: usize) -> &mut Self::Output {
164172
&mut self.inner[index]
165173
}

0 commit comments

Comments
 (0)