Skip to content

Commit

Permalink
qe: remove duplicate InMemoryRecordProcessor::take_abs method (#4745)
Browse files Browse the repository at this point in the history
`InMemoryRecordProcessor` derefs to `QueryArguments`, and
`QueryArguments` already has an identical `take_abs` method.

Additionally, hand-written `abs` implementation was replaced with a call
to `i64::abs` method.
  • Loading branch information
aqrln authored Feb 20, 2024
1 parent 5a9203d commit b5b60c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ impl InMemoryRecordProcessor {
processor
}

fn take_abs(&self) -> Option<i64> {
self.take.map(|t| if t < 0 { -t } else { t })
}

/// Checks whether or not we need to take records going backwards in the record list,
/// which requires reversing the list of records at some point.
fn needs_reversed_order(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion query-engine/query-structure/src/query_arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl QueryArguments {
}

pub fn take_abs(&self) -> Option<i64> {
self.take.map(|t| if t < 0 { -t } else { t })
self.take.map(|t| t.abs())
}

pub fn has_unbatchable_ordering(&self) -> bool {
Expand Down

0 comments on commit b5b60c4

Please sign in to comment.