summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2018-01-02 22:00:43 -0500
committerKurt Hindenburg <[email protected]>2018-01-02 22:00:43 -0500
commita588e099fae57fb7e51cf1e7ef9edd899cb1f240 (patch)
tree32163b9ab7ec319677c0f403f9548c9214e89922
parenta8842603c2fc4f06fe826b38f27f9cdb3e650534 (diff)
readability fixes - braces
-rw-r--r--src/History.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/History.cpp b/src/History.cpp
index 46d1da0..11ce01e 100644
--- a/src/History.cpp
+++ b/src/History.cpp
@@ -144,8 +144,9 @@ void HistoryFile::unmap()
{
Q_ASSERT(_fileMap != nullptr);
- if (_tmpFile.unmap(_fileMap))
+ if (_tmpFile.unmap(_fileMap)) {
_fileMap = nullptr;
+ }
Q_ASSERT(_fileMap == nullptr);
@@ -162,8 +163,9 @@ void HistoryFile::add(const char *buffer, qint64 count)
unmap();
}
- if (_readWriteBalance < INT_MAX)
+ if (_readWriteBalance < INT_MAX) {
_readWriteBalance++;
+ }
qint64 rc = 0;
@@ -191,8 +193,9 @@ void HistoryFile::get(char *buffer, qint64 size, qint64 loc)
//If there are many more get() calls compared with add()
//calls (decided by using MAP_THRESHOLD) then mmap the log
//file to improve performance.
- if (_readWriteBalance > INT_MIN)
+ if (_readWriteBalance > INT_MIN) {
_readWriteBalance--;
+ }
if ((_fileMap == nullptr) && _readWriteBalance < MAP_THRESHOLD) {
map();
}