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

feat: Expose AexprArena #20230

Merged
merged 1 commit into from
Dec 9, 2024
Merged
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
10 changes: 5 additions & 5 deletions crates/polars-plan/src/plans/visitor/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ impl AExpr {

#[cfg(feature = "cse")]
impl<'a> AExprArena<'a> {
fn new(node: Node, arena: &'a Arena<AExpr>) -> Self {
pub fn new(node: Node, arena: &'a Arena<AExpr>) -> Self {
Self { node, arena }
}
fn to_aexpr(&self) -> &'a AExpr {
pub fn to_aexpr(&self) -> &'a AExpr {
self.arena.get(self.node)
}

// Check single node on equality
fn is_equal_single(&self, other: &Self) -> bool {
pub fn is_equal_single(&self, other: &Self) -> bool {
let self_ae = self.to_aexpr();
let other_ae = other.to_aexpr();
self_ae.is_equal_node(other_ae)
Expand All @@ -245,8 +245,8 @@ impl<'a> AExprArena<'a> {
#[cfg(feature = "cse")]
impl PartialEq for AExprArena<'_> {
fn eq(&self, other: &Self) -> bool {
let mut scratch1 = vec![];
let mut scratch2 = vec![];
let mut scratch1 = unitvec![];
let mut scratch2 = unitvec![];

scratch1.push(self.node);
scratch2.push(other.node);
Expand Down
Loading