Skip to content

Commit

Permalink
Add VersionSpec::expression_size
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Mar 5, 2024
1 parent 80cbd3b commit d7e5407
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libmamba/include/mamba/specs/version_spec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ namespace mamba::specs
*/
[[nodiscard]] auto contains(const Version& point) const -> bool;

/**
* Return the size of the boolean expression tree.
*/
[[nodiscard]] auto expression_size() const -> std::size_t;

private:

tree_type m_tree;
Expand Down
5 changes: 5 additions & 0 deletions libmamba/src/specs/version_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ namespace mamba::specs
return fmt::format("{:b}", *this);
}

auto VersionSpec::expression_size() const -> std::size_t
{
return m_tree.size();
}

namespace
{
template <typename Val, typename Range>
Expand Down

0 comments on commit d7e5407

Please sign in to comment.