mirror of
https://github.com/PDB-REDO/libcifpp.git
synced 2026-06-04 13:54:25 +08:00
Assertions added
This commit is contained in:
@@ -827,9 +827,6 @@ struct const_item_handle
|
||||
/** Easy way to test for an empty item */
|
||||
explicit operator bool() const { return not empty(); }
|
||||
|
||||
/** Return a std::string_view for the contents */
|
||||
[[nodiscard]] std::string_view text_() const;
|
||||
|
||||
/**
|
||||
* @brief Construct a new item handle object
|
||||
*
|
||||
|
||||
@@ -398,7 +398,7 @@ class const_row_handle
|
||||
/// \brief return a cif::item_handle to the item in the item named @a item_name
|
||||
const_item_handle operator[](std::string_view item_name) const
|
||||
{
|
||||
return { *m_category, *m_row, get_item_ix(item_name) };
|
||||
return operator[](get_item_ix(item_name));
|
||||
}
|
||||
|
||||
/// \brief Return an object that can be used in combination with cif::tie
|
||||
|
||||
@@ -1030,9 +1030,8 @@ condition category::get_parents_condition(const_row_handle rh, const category &p
|
||||
condition result;
|
||||
|
||||
auto links = m_validator->get_links_for_child(m_name);
|
||||
auto e = std::ranges::remove_if(links, [n = parentCat.m_name](auto &l)
|
||||
std::erase_if(links, [n = parentCat.m_name](auto &l)
|
||||
{ return l->m_parent_category != n; });
|
||||
links.erase(e.begin(), e.end());
|
||||
|
||||
if (not links.empty())
|
||||
{
|
||||
|
||||
@@ -43,11 +43,13 @@ bool item_handle::empty() const
|
||||
|
||||
item_value &item_handle::value()
|
||||
{
|
||||
assert(m_item_ix < m_row.size());
|
||||
return m_row.operator[](m_item_ix);
|
||||
}
|
||||
|
||||
const item_value &item_handle::value() const
|
||||
{
|
||||
assert(m_item_ix < m_row.size());
|
||||
return m_row.operator[](m_item_ix);
|
||||
}
|
||||
|
||||
@@ -64,6 +66,7 @@ bool const_item_handle::empty() const
|
||||
|
||||
const item_value &const_item_handle::value() const
|
||||
{
|
||||
assert(m_item_ix < m_row.size());
|
||||
return m_row.operator[](m_item_ix);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ list(
|
||||
unit-3d
|
||||
model
|
||||
# query
|
||||
# rename-compound
|
||||
rename-compound
|
||||
# sugar
|
||||
# spinner
|
||||
# reconstruction
|
||||
|
||||
Reference in New Issue
Block a user