Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
eacc8056
Commit
eacc8056
authored
May 25, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: complex unnecessary ternary expressions
Solution: simplify to comparison against 0
parent
14320112
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
13 deletions
+13
-13
dist.cpp
src/dist.cpp
+1
-1
fq.cpp
src/fq.cpp
+1
-1
lb.cpp
src/lb.cpp
+2
-2
pipe.cpp
src/pipe.cpp
+1
-1
router.cpp
src/router.cpp
+3
-3
session_base.cpp
src/session_base.cpp
+1
-1
socket_base.cpp
src/socket_base.cpp
+1
-1
xpub.cpp
src/xpub.cpp
+1
-1
xsub.cpp
src/xsub.cpp
+2
-2
No files found.
src/dist.cpp
View file @
eacc8056
...
...
@@ -141,7 +141,7 @@ int zmq::dist_t::send_to_all (msg_t *msg_)
int
zmq
::
dist_t
::
send_to_matching
(
msg_t
*
msg_
)
{
// Is this end of a multipart message?
bool
msg_more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
bool
msg_more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
// Push the message to matching pipes.
distribute
(
msg_
);
...
...
src/fq.cpp
View file @
eacc8056
...
...
@@ -99,7 +99,7 @@ int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_)
if
(
fetched
)
{
if
(
pipe_
)
*
pipe_
=
pipes
[
current
];
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
if
(
!
more
)
{
last_in
=
pipes
[
current
];
current
=
(
current
+
1
)
%
active
;
...
...
src/lb.cpp
View file @
eacc8056
...
...
@@ -85,7 +85,7 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
// Drop the message if required. If we are at the end of the message
// switch back to non-dropping mode.
if
(
dropping
)
{
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
dropping
=
more
;
int
rc
=
msg_
->
close
();
...
...
@@ -127,7 +127,7 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
// If it's final part of the message we can flush it downstream and
// continue round-robining (load balance).
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
if
(
!
more
)
{
pipes
[
current
]
->
flush
();
...
...
src/pipe.cpp
View file @
eacc8056
...
...
@@ -233,7 +233,7 @@ bool zmq::pipe_t::write (msg_t *msg_)
if
(
unlikely
(
!
check_write
()))
return
false
;
bool
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
bool
more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
const
bool
is_routing_id
=
msg_
->
is_routing_id
();
outpipe
->
write
(
*
msg_
,
more
);
if
(
!
more
&&
!
is_routing_id
)
...
...
src/router.cpp
View file @
eacc8056
...
...
@@ -254,7 +254,7 @@ int zmq::router_t::xsend (msg_t *msg_)
msg_
->
reset_flags
(
msg_t
::
more
);
// Check whether this is the last part of the message.
more_out
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more_out
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
// Push the message into the pipe. If there's no out pipe, just drop it.
if
(
current_out
)
{
...
...
@@ -310,7 +310,7 @@ int zmq::router_t::xrecv (msg_t *msg_)
errno_assert
(
rc
==
0
);
prefetched
=
false
;
}
more_in
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more_in
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
if
(
!
more_in
)
{
if
(
terminate_current_in
)
{
...
...
@@ -338,7 +338,7 @@ int zmq::router_t::xrecv (msg_t *msg_)
// If we are in the middle of reading a message, just return the next part.
if
(
more_in
)
{
more_in
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more_in
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
if
(
!
more_in
)
{
if
(
terminate_current_in
)
{
...
...
src/session_base.cpp
View file @
eacc8056
...
...
@@ -156,7 +156,7 @@ int zmq::session_base_t::pull_msg (msg_t *msg_)
return
-
1
;
}
incomplete_in
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
incomplete_in
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
return
0
;
}
...
...
src/socket_base.cpp
View file @
eacc8056
...
...
@@ -1576,7 +1576,7 @@ void zmq::socket_base_t::extract_flags (msg_t *msg_)
zmq_assert
(
options
.
recv_routing_id
);
// Remove MORE flag.
rcvmore
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
rcvmore
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
}
int
zmq
::
socket_base_t
::
monitor
(
const
char
*
addr_
,
int
events_
)
...
...
src/xpub.cpp
View file @
eacc8056
...
...
@@ -230,7 +230,7 @@ void zmq::xpub_t::mark_as_matching (pipe_t *pipe_, xpub_t *self_)
int
zmq
::
xpub_t
::
xsend
(
msg_t
*
msg_
)
{
bool
msg_more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
bool
msg_more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
// For the first part of multi-part message, find the matching pipes.
if
(
!
more
)
{
...
...
src/xsub.cpp
View file @
eacc8056
...
...
@@ -134,7 +134,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_)
int
rc
=
msg_
->
move
(
message
);
errno_assert
(
rc
==
0
);
has_message
=
false
;
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
return
0
;
}
...
...
@@ -153,7 +153,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_)
// Check whether the message matches at least one subscription.
// Non-initial parts of the message are passed
if
(
more
||
!
options
.
filter
||
match
(
msg_
))
{
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
more
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment