* Minor cleanup.

This commit is contained in:
Eelco Dolstra 2006-06-01 18:13:33 +00:00
parent 2d456fc35a
commit 23960e92df
1 changed files with 3 additions and 7 deletions

View File

@ -707,14 +707,12 @@ static Path _addToStore(bool fixed, bool recursive,
if (!readOnlyMode) addTempRoot(dstPath);
if (!readOnlyMode && !isValidPath(dstPath)) {
if (!readOnlyMode && !isValidPath(dstPath)) {
/* The first check above is an optimisation to prevent
unnecessary lock acquisition. */
PathSet lockPaths;
lockPaths.insert(dstPath);
PathLocks outputLock(lockPaths);
PathLocks outputLock(singleton<PathSet, Path>(dstPath));
if (!isValidPath(dstPath)) {
@ -764,9 +762,7 @@ Path addTextToStore(const string & suffix, const string & s,
if (!readOnlyMode && !isValidPath(dstPath)) {
PathSet lockPaths;
lockPaths.insert(dstPath);
PathLocks outputLock(lockPaths);
PathLocks outputLock(singleton<PathSet, Path>(dstPath));
if (!isValidPath(dstPath)) {