Whitespace and style fixes

This commit is contained in:
Pieter Hintjens
2012-10-24 09:18:52 +09:00
parent 066606322c
commit 4ba34c9d70
15 changed files with 270 additions and 235 deletions

View File

@@ -53,7 +53,8 @@ zmq::mtrie_t::~mtrie_t ()
delete next.node;
next.node = 0;
}
else if (count > 1) {
else
if (count > 1) {
for (unsigned short i = 0; i != count; ++i)
if (next.table [i])
delete next.table [i];
@@ -90,7 +91,8 @@ bool zmq::mtrie_t::add_helper (unsigned char *prefix_, size_t size_,
count = 1;
next.node = NULL;
}
else if (count == 1) {
else
if (count == 1) {
unsigned char oldc = min;
mtrie_t *oldp = next.node;
count = (min < c ? c - min : min - c) + 1;
@@ -102,8 +104,8 @@ bool zmq::mtrie_t::add_helper (unsigned char *prefix_, size_t size_,
min = std::min (min, c);
next.table [oldc - min] = oldp;
}
else if (min < c) {
else
if (min < c) {
// The new character is above the current character range.
unsigned short old_count = count;
count = c - min + 1;
@@ -114,7 +116,6 @@ bool zmq::mtrie_t::add_helper (unsigned char *prefix_, size_t size_,
next.table [i] = NULL;
}
else {
// The new character is below the current character range.
unsigned short old_count = count;
count = (min + old_count) - c;
@@ -244,7 +245,8 @@ void zmq::mtrie_t::rm_helper (pipe_t *pipe_, unsigned char **buff_,
count = 0;
}
// Compact the node table if possible
else if (live_nodes == 1) {
else
if (live_nodes == 1) {
// If there's only one live node in the table we can
// switch to using the more compact single-node
// representation
@@ -257,7 +259,8 @@ void zmq::mtrie_t::rm_helper (pipe_t *pipe_, unsigned char **buff_,
count = 1;
min = new_min;
}
else if (new_min > min || new_max < min + count - 1) {
else
if (new_min > min || new_max < min + count - 1) {
zmq_assert (new_max - new_min + 1 > 1);
mtrie_t **old_table = next.table;
@@ -342,7 +345,8 @@ bool zmq::mtrie_t::rm_helper (unsigned char *prefix_, size_t size_,
free (next.table);
next.node = oldp;
}
else if (c == min) {
else
if (c == min) {
// We can compact the table "from the left"
unsigned short i;
for (i = 1; i < count; ++i)
@@ -358,7 +362,8 @@ bool zmq::mtrie_t::rm_helper (unsigned char *prefix_, size_t size_,
memmove (next.table, old_table + i, sizeof (mtrie_t*) * count);
free (old_table);
}
else if (c == min + count - 1) {
else
if (c == min + count - 1) {
// We can compact the table "from the right"
unsigned short i;
for (i = 1; i < count; ++i)