mirror of
https://github.com/PDB-REDO/libcifpp.git
synced 2026-06-04 13:54:25 +08:00
Check only first datablock
This commit is contained in:
13
src/file.cpp
13
src/file.cpp
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "cif++/file.hpp"
|
||||
#include "cif++/condition.hpp"
|
||||
#include "cif++/gzio.hpp"
|
||||
|
||||
namespace cif
|
||||
@@ -46,8 +47,16 @@ bool file::is_valid()
|
||||
{
|
||||
bool result = not empty();
|
||||
|
||||
for (auto &d : *this)
|
||||
result = d.is_valid() and result;
|
||||
for (bool first = true; auto &d : *this)
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
result = d.is_valid() and result;
|
||||
first = false;
|
||||
}
|
||||
else if (d.get_validator() != nullptr)
|
||||
result = d.is_valid() and result;
|
||||
}
|
||||
|
||||
if (result)
|
||||
result = validate_links();
|
||||
|
||||
Reference in New Issue
Block a user