Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickable::tick should return without ref #19

Merged
merged 1 commit into from
Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/gat/tumbling_operator/periodic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ where
P: PeriodicOp<I, T>,
{
fn step(&mut self, mut queue: QueueMut<T>, event: I) {
if self.period.same_window(&self.last, event.tick()) {
if self.period.same_window(&self.last, &event.tick()) {
let output = self.op.swap(queue.as_queue_ref(), event);
queue.swap(output);
} else {
self.last = *event.tick();
self.last = event.tick();
let output = self.op.push(queue.as_queue_ref(), event);
queue.push(output);
}
Expand All @@ -87,11 +87,11 @@ where
P: PeriodicOp<I, T>,
{
fn step(&mut self, mut queue: QueueMut<T>, event: I) {
if self.period.same_window(&self.last, event.tick()) {
if self.period.same_window(&self.last, &event.tick()) {
let output = self.op.swap(queue.as_queue_ref(), event);
queue.swap(output);
} else {
self.last = *event.tick();
self.last = event.tick();
if let Some(last) = queue.get(0).cloned() {
queue.push(last);
let mut output = self.op.push(queue.as_queue_ref(), event);
Expand Down
4 changes: 2 additions & 2 deletions src/rayon/ticked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ where
)>;

fn next(&mut self, input: I) -> Self::Output {
let tick = *input.tick();
let tick = input.tick();
let i1 = input.clone();
let (o1, o2) = rayon::join(
|| self.0.next(i1).into_tick_value().value,
Expand Down Expand Up @@ -60,7 +60,7 @@ where
type Output = TickValue<HashMap<Q, <P::Output as Tickable>::Value>>;

fn next(&mut self, input: I) -> Self::Output {
let tick = *input.tick();
let tick = input.tick();
let value = self
.0
.par_iter_mut()
Expand Down
4 changes: 2 additions & 2 deletions src/ticked/facet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ where
)>;

fn next(&mut self, input: I) -> Self::Output {
let tick = *input.tick();
let tick = input.tick();
let o1 = self.0.next(input.clone()).into_tick_value().value;
let o2 = self.1.next(input).into_tick_value().value;
TickValue {
Expand Down Expand Up @@ -59,7 +59,7 @@ mod facet_map {
type Output = TickValue<HashMap<Q, <P::Output as Tickable>::Value>>;

fn next(&mut self, input: I) -> Self::Output {
let tick = *input.tick();
let tick = input.tick();
let value = self
.0
.iter_mut()
Expand Down
4 changes: 2 additions & 2 deletions src/window/tick_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ impl<T> TickValue<T> {
impl<T> Tickable for TickValue<T> {
type Value = T;

fn tick(&self) -> &Tick {
&self.tick
fn tick(&self) -> Tick {
self.tick
}

fn value(&self) -> &Self::Value {
Expand Down
2 changes: 1 addition & 1 deletion src/window/tickable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub trait Tickable {
type Value;

/// Get the tick.
fn tick(&self) -> &Tick;
fn tick(&self) -> Tick;

/// Get the value.
fn value(&self) -> &Self::Value;
Expand Down