Bug 1162336 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj
Check that logging is enabled before performing potentially expensive operations.
This commit is contained in:
8
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
8
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
@@ -225,9 +225,11 @@ nsOfflineCacheEvictionFunction::Apply()
|
||||
LOG(("nsOfflineCacheEvictionFunction::Apply\n"));
|
||||
|
||||
for (int32_t i = 0; i < mItems.Count(); i++) {
|
||||
nsAutoCString path;
|
||||
mItems[i]->GetNativePath(path);
|
||||
LOG((" removing %s\n", path.get()));
|
||||
if (PR_LOG_TEST(gCacheLog, PR_LOG_DEBUG)) {
|
||||
nsAutoCString path;
|
||||
mItems[i]->GetNativePath(path);
|
||||
LOG((" removing %s\n", path.get()));
|
||||
}
|
||||
|
||||
mItems[i]->Remove(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user