Fix a BibTeX caching bug. Because we only set the last modified time

when the cache was valid, we did not set it the first time through and
so always read the cache twice.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32890 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-01-08 18:18:05 +00:00
parent 473f25bbec
commit 295b84e8fb

View File

@ -1647,18 +1647,16 @@ BiblioInfo const & Buffer::localBibInfo() const
void Buffer::checkBibInfoCache() const
{
if (d->bibinfoCacheValid_) {
support::FileNameList const & bibfilesCache = getBibfilesCache();
// compare the cached timestamps with the actual ones.
support::FileNameList::const_iterator ei = bibfilesCache.begin();
support::FileNameList::const_iterator en = bibfilesCache.end();
for (; ei != en; ++ ei) {
time_t lastw = ei->lastModified();
if (lastw != d->bibfileStatus_[*ei]) {
time_t prevw = d->bibfileStatus_[*ei];
if (lastw != prevw) {
d->bibinfoCacheValid_ = false;
d->bibfileStatus_[*ei] = lastw;
break;
}
}
}