Skip to content

Commit 1697205

Browse files
committed
Removed 'not` keyword in conditionals
1 parent 28e4abc commit 1697205

58 files changed

Lines changed: 174 additions & 174 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

example/01-echo/libp2p_echo_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
6868
// Additional logging config for application
6969
logger_config));
7070
auto r = logging_system->configure();
71-
if (not r.message.empty()) {
71+
if (!r.message.empty()) {
7272
(r.has_error ? std::cerr : std::cout) << r.message << std::endl;
7373
}
7474
if (r.has_error) {

example/01-echo/libp2p_echo_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int main(int argc, char **argv) {
9090
// Additional logging config for application
9191
logger_config));
9292
auto r = logging_system->configure();
93-
if (not r.message.empty()) {
93+
if (!r.message.empty()) {
9494
(r.has_error ? std::cerr : std::cout) << r.message << std::endl;
9595
}
9696
if (r.has_error) {

example/02-kademlia/rendezvous_chat.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Session : public std::enable_shared_from_this<Session> {
4949
stream_->readSome(
5050
*incoming_,
5151
[self = shared_from_this()](outcome::result<size_t> result) {
52-
if (not result) {
52+
if (!result) {
5353
self->close();
5454
std::cout << self->stream_->remotePeerId().value().toBase58()
5555
<< " - closed at reading" << std::endl;
@@ -74,7 +74,7 @@ class Session : public std::enable_shared_from_this<Session> {
7474
stream_,
7575
*buffer,
7676
[self = shared_from_this(), buffer](outcome::result<void> result) {
77-
if (not result) {
77+
if (!result) {
7878
self->close();
7979
std::cout << self->stream_->remotePeerId().value().toBase58()
8080
<< " - closed at writting" << std::endl;
@@ -128,7 +128,7 @@ void handleIncomingStream(libp2p::StreamAndProtocol stream_and_protocol) {
128128
}
129129

130130
void handleOutgoingStream(libp2p::StreamAndProtocolOrError stream_res) {
131-
if (not stream_res) {
131+
if (!stream_res) {
132132
fmt::println(
133133
std::cerr, " ! outgoing connection failed: {}", stream_res.error());
134134
return;
@@ -178,7 +178,7 @@ int main(int argc, char *argv[]) {
178178
// Additional logging config for application
179179
logger_config));
180180
auto r = logging_system->configure();
181-
if (not r.message.empty()) {
181+
if (!r.message.empty()) {
182182
(r.has_error ? std::cerr : std::cout) << r.message << std::endl;
183183
}
184184
if (r.has_error) {
@@ -295,7 +295,7 @@ int main(int argc, char *argv[]) {
295295
scheduler.schedule(std::function{find_providers},
296296
kademlia_config.randomWalk.interval);
297297

298-
if (not res) {
298+
if (!res) {
299299
fmt::println(std::cerr, "Cannot find providers: {}", res.error());
300300
return;
301301
}
@@ -317,7 +317,7 @@ int main(int argc, char *argv[]) {
317317

318318
post(*io, [&] {
319319
auto listen = host->listen(ma);
320-
if (not listen) {
320+
if (!listen) {
321321
fmt::println(std::cerr,
322322
"Cannot listen address {}. Error: {}",
323323
ma.getStringAddress(),

example/03-gossip/gossip_chat_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int main(int argc, char *argv[]) {
6767
// Additional logging config for application
6868
logger_config));
6969
auto r = logging_system->configure();
70-
if (not r.message.empty()) {
70+
if (!r.message.empty()) {
7171
(r.has_error ? std::cerr : std::cout) << r.message << std::endl;
7272
}
7373
if (r.has_error) {

example/04-dnstxt/ares_resolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
3838
// Additional logging config for application
3939
logger_config));
4040
auto r = logging_system->configure();
41-
if (not r.message.empty()) {
41+
if (!r.message.empty()) {
4242
(r.has_error ? std::cerr : std::cout) << r.message << std::endl;
4343
}
4444
if (r.has_error) {

include/libp2p/basic/read.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace libp2p {
3636
}
3737
// read remaining bytes
3838
auto reader = weak.lock();
39-
if (not reader) {
39+
if (!reader) {
4040
return cb(make_error_code(boost::asio::error::operation_aborted));
4141
}
4242
read(reader, out.subspan(n), std::move(cb));

include/libp2p/basic/write.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace libp2p {
3636
}
3737
// write remaining bytes
3838
auto writer = weak.lock();
39-
if (not writer) {
39+
if (!writer) {
4040
return cb(make_error_code(boost::asio::error::operation_aborted));
4141
}
4242
write(writer, in.subspan(n), std::move(cb));

include/libp2p/common/outcome_macro.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define _IF_ERROR_CB_RETURN(tmp, r) \
1212
({ \
1313
auto &&_r = r; \
14-
if (not _r.has_value()) { \
14+
if (!_r.has_value()) { \
1515
return cb(_r.error()); \
1616
} \
1717
_r.value(); \

include/libp2p/injector/network_injector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace libp2p::injector {
160160
*/
161161
inline auto useWssPem(std::string_view pem) {
162162
layer::WssCertificate cert;
163-
if (not pem.empty()) {
163+
if (!pem.empty()) {
164164
if (auto cert_res = layer::WssCertificate::make(pem)) {
165165
cert = std::move(cert_res.value());
166166
} else {

include/libp2p/transport/tcp/tcp_util.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace libp2p::transport::detail {
128128
auto v = ma.getProtocolsWithValues();
129129
auto it = v.begin();
130130
OUTCOME_TRY(addr, readTcpOrUdp(it, v.end()));
131-
if (not addr.udp) {
131+
if (!addr.udp) {
132132
return std::errc::protocol_not_supported;
133133
}
134134
if (it == v.end()) {
@@ -185,7 +185,7 @@ namespace libp2p::transport::detail {
185185
const boost::asio::ip::tcp::endpoint &endpoint,
186186
const ProtoAddrVec &layers) {
187187
OUTCOME_TRY(s, toMultiaddr(endpoint));
188-
if (not layers.empty()) {
188+
if (!layers.empty()) {
189189
auto &protocol = layers.at(0).first.code;
190190
if (protocol == P::WS) {
191191
s += "/ws";

0 commit comments

Comments
 (0)