Skip to main content

oxilean_parse/pattern/
patterncompiler_analyze_usefulness_group.rs

1//! # PatternCompiler - analyze_usefulness_group Methods
2//!
3//! This module contains method implementations for `PatternCompiler`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use crate::Pattern;
8
9use super::types::PatternRow;
10
11use super::patterncompiler_type::PatternCompiler;
12
13impl PatternCompiler {
14    /// Analyze pattern usefulness using basic algorithm.
15    pub fn analyze_usefulness(&self, rows: &[PatternRow], new_pattern: &[Pattern]) -> bool {
16        rows.is_empty() || !self.subsumes_all(rows, new_pattern)
17    }
18}