@@ -3232,14 +3232,14 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,bool &ambi
3232
3232
ambig=FALSE ;
3233
3233
if (n.isEmpty ()) return 0 ;
3234
3234
3235
- std::lock_guard<std::mutex> lock (g_findFileDefMutex);
3236
3235
3237
3236
const int maxAddrSize = 20 ;
3238
3237
char addr[maxAddrSize];
3239
3238
qsnprintf (addr,maxAddrSize," %p:" ,reinterpret_cast <const void *>(fnMap));
3240
3239
QCString key = addr;
3241
3240
key+=n;
3242
3241
3242
+ std::lock_guard<std::mutex> lock (g_findFileDefMutex);
3243
3243
FindFileCacheElem *cachedResult = g_findFileDefCache.find (key.str ());
3244
3244
// printf("key=%s cachedResult=%p\n",qPrint(key),cachedResult);
3245
3245
if (cachedResult)
@@ -3256,16 +3256,16 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,bool &ambi
3256
3256
QCString name=Dir::cleanDirPath (n.str ());
3257
3257
QCString path;
3258
3258
int slashPos;
3259
- const FileName *fn;
3260
- if (name.isEmpty ()) goto exit;
3259
+ if (name.isEmpty ()) return 0 ;
3261
3260
slashPos=std::max (name.findRev (' /' ),name.findRev (' \\ ' ));
3262
3261
if (slashPos!=-1 )
3263
3262
{
3264
3263
path=name.left (slashPos+1 );
3265
3264
name=name.right (name.length ()-slashPos-1 );
3266
3265
}
3267
- if (name.isEmpty ()) goto exit;
3268
- if ((fn=fnMap->find (name)))
3266
+ if (name.isEmpty ()) return 0 ;
3267
+ const FileName *fn = fnMap->find (name);
3268
+ if (fn)
3269
3269
{
3270
3270
// printf("fn->size()=%zu\n",fn->size());
3271
3271
if (fn->size ()==1 )
@@ -3306,8 +3306,6 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,bool &ambi
3306
3306
{
3307
3307
// printf("not found!\n");
3308
3308
}
3309
- exit:
3310
- // delete cachedResult;
3311
3309
return 0 ;
3312
3310
}
3313
3311
0 commit comments