Skip to content

Commit d91029d

Browse files
committed
Avoid repeating evaluation of the invariant pre-condition which is already known to be TRUE
1 parent 05614ce commit d91029d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/jrd/recsrc/FilteredStream.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ bool FilteredStream::internalGetRecord(thread_db* tdbb) const
9494
if (!(impure->irsb_flags & irsb_open))
9595
return false;
9696

97+
if (m_invariant)
98+
{
99+
if (!m_next->getRecord(tdbb))
100+
{
101+
invalidateRecords(request);
102+
return false;
103+
}
104+
105+
return true;
106+
}
107+
97108
if (!evaluateBoolean(tdbb))
98109
{
99110
invalidateRecords(request);

0 commit comments

Comments
 (0)