bool RCommitLog::findNextCommit(RCommit& commit, int attempts) { for(int i=0;i<attempts;i++) { RCommit c; if(nextCommit(c)) { commit = c; return true; } } return false; }
bool RCommitLog::checkFormat() { if(!success) return false; //read a commit to see if the log is in the correct format if(nextCommit(lastCommit, false)) { if(seekable) { //if the log is seekable, go back to the start ((SeekLog*)logf)->seekTo(0.0); } else { //otherwise set the buffered flag as we have bufferd one commit buffered = true; } return true; } return false; }