versionsToKeep = (maxVersion - maxVersionByTime);
} else {
versionsToKeep = Math.min(versionsToKeep, (maxVersion - maxVersionByTime));
}
}
<BUG>}
if ((maxVersion - versionsToKeep) <= 0) {
</BUG>
internalCleanup(dbc, resource);
return 0;

versionsToKeep = (maxVersion - maxVersionByTime);
} else {
versionsToKeep = Math.min(versionsToKeep, (maxVersion - maxVersionByTime));
}
}
}
int structureVersions = 0;
conn = m_sqlManager.getConnection(dbc);
if (!noHistoryStructure) {
if (((maxVersion - versionsToKeep) <= 0)) {
internalCleanup(dbc, resource);
return 0;
