@@ -374,44 +374,41 @@ std::string CResource::CalculateACLRequestFingerprint()
374
374
{
375
375
std::string strPath;
376
376
if (!GetFilePath (" meta.xml" , strPath))
377
- return " " ;
377
+ return {} ;
378
378
379
- CXMLFile* pMetaFile = g_pServerInterface->GetXML ()->CreateXML (strPath.c_str ());
380
- if (!pMetaFile || !pMetaFile ->Parse ())
379
+ std::unique_ptr< CXMLFile> metaFile ( g_pServerInterface->GetXML ()->CreateXML (strPath.c_str () ));
380
+ if (!metaFile || !metaFile ->Parse ())
381
381
{
382
- delete pMetaFile;
383
382
return " " ;
384
383
}
385
384
386
- CXMLNode* pRoot = pMetaFile ->GetRootNode ();
387
- if (!pRoot )
385
+ CXMLNode* root = metaFile ->GetRootNode ();
386
+ if (!root )
388
387
{
389
- delete pMetaFile;
390
388
return " " ;
391
389
}
392
390
393
- std::string strFingerprint ;
394
- CXMLNode* pNodeAclRequest = pRoot ->FindSubNode (" aclrequest" , 0 );
391
+ std::ostringstream fingerprint ;
392
+ CXMLNode* nodeAclRequest = root ->FindSubNode (" aclrequest" , 0 );
395
393
396
- if (pNodeAclRequest )
394
+ if (nodeAclRequest )
397
395
{
398
- for (uint uiIndex = 0 ; true ; uiIndex++)
396
+ for (std:: uint8_t uiIndex = 0 ; true ; uiIndex++)
399
397
{
400
- CXMLNode* pNodeRight = pNodeAclRequest ->FindSubNode (" right" , uiIndex);
401
- if (!pNodeRight )
398
+ CXMLNode* nodeRight = nodeAclRequest ->FindSubNode (" right" , uiIndex);
399
+ if (!nodeRight )
402
400
break ;
403
401
404
- std::string strName = pNodeRight ->GetAttributeValue (" name" );
405
- std::string strAccess = pNodeRight ->GetAttributeValue (" access" );
406
-
407
- if (!strFingerprint. empty () )
408
- strFingerprint += " ;" ;
409
- strFingerprint += strName + " :" + strAccess;
402
+ std::string strName = nodeRight ->GetAttributeValue (" name" );
403
+ std::string strAccess = nodeRight ->GetAttributeValue (" access" );
404
+
405
+ if (uiIndex > 0 )
406
+ fingerprint << " ;" ;
407
+ fingerprint << strName << " :" << strAccess;
410
408
}
411
409
}
412
410
413
- delete pMetaFile;
414
- return strFingerprint;
411
+ return fingerprint.str ();
415
412
}
416
413
417
414
bool CResource::HasACLRequestsChanged ()
0 commit comments