Skip to content

Commit b5904e0

Browse files
author
nitrocaster
committed
Wrap bucket list verification code into disabled preprocessor block.
1 parent c0a47e2 commit b5904e0

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

src/xrAICore/Navigation/data_storage_bucket_list_inline.h

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,29 +96,37 @@ IC u32 CBucketList::compute_bucket_id (CGraphVertex &vertex) const
9696
TEMPLATE_SPECIALIZATION
9797
IC void CBucketList::verify_buckets () const
9898
{
99-
// for (u32 i=0; i<bucket_count; ++i) {
100-
// CGraphVertex *j = m_buckets[i], *k;
101-
// if (!j || (indexes[j->index()].m_path_id != current_path_id()) || (indexes[j->index()].vertex != j))
102-
// continue;
103-
// u32 count = 0, count1 = 0;
104-
// for ( ; j; k=j,j=j->next(), ++count) {
105-
// VERIFY (indexes[j->index()].m_path_id == current_path_id());
106-
// VERIFY (compute_bucket_id(*j) == i);
107-
// VERIFY (!j->prev() || (j == j->prev()->next()));
108-
// VERIFY (!j->next() || (j == j->next()->prev()));
109-
// VERIFY (!j->next() || (j != j->next()));
110-
// VERIFY (!j->prev() || (j != j->prev()));
111-
// }
112-
// for ( ; k; k=k->prev(), ++count1) {
113-
// VERIFY (indexes[k->index()].m_path_id == current_path_id());
114-
// VERIFY (compute_bucket_id(*k) == i);
115-
// VERIFY (!k->prev() || (k == k->prev()->next()));
116-
// VERIFY (!k->next() || (k == k->next()->prev()));
117-
// VERIFY (!k->next() || (k != k->next()));
118-
// VERIFY (!k->prev() || (k != k->prev()));
119-
// }
120-
// VERIFY (count == count1);
121-
// }
99+
#if 0
100+
for (u32 i = 0; i<bucket_count; i++)
101+
{
102+
CGraphVertex *j = m_buckets[i], *k;
103+
if (!j)
104+
continue;
105+
auto index = indexes[j->index()];
106+
if (index.m_path_id!=current_path_id() || index.vertex!=j)
107+
continue;
108+
u32 count1 = 0, count2 = 0;
109+
for (; j; k = j, j = j->next(), count1++)
110+
{
111+
VERIFY(indexes[j->index()].m_path_id==current_path_id());
112+
VERIFY(compute_bucket_id(*j)==i);
113+
VERIFY(!j->prev() || j==j->prev()->next());
114+
VERIFY(!j->next() || j==j->next()->prev());
115+
VERIFY(!j->next() || j!=j->next());
116+
VERIFY(!j->prev() || j!=j->prev());
117+
}
118+
for (; k; k = k->prev(), count2++)
119+
{
120+
VERIFY(indexes[k->index()].m_path_id==current_path_id());
121+
VERIFY(compute_bucket_id(*k)==i);
122+
VERIFY(!k->prev() || k==k->prev()->next());
123+
VERIFY(!k->next() || k==k->next()->prev());
124+
VERIFY(!k->next() || k!=k->next());
125+
VERIFY(!k->prev() || k!=k->prev());
126+
}
127+
VERIFY(count1==count2);
128+
}
129+
#endif
122130
}
123131

124132
TEMPLATE_SPECIALIZATION

0 commit comments

Comments
 (0)