Skip to content

Commit

Permalink
report: remove unnecessary case block scopes
Browse files Browse the repository at this point in the history
PR-URL: #25960
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
cjihrig authored and addaleax committed Feb 8, 2019
1 parent 7443288 commit 8494a61
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/node_report_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ void ReportEndpoints(uv_handle_t* h, std::ostringstream& out) {
int rc = -1;

switch (h->type) {
case UV_UDP: {
case UV_UDP:
rc = uv_udp_getsockname(&(handle->udp), addr, &addr_size);
break;
}
case UV_TCP: {
case UV_TCP:
rc = uv_tcp_getsockname(&(handle->tcp), addr, &addr_size);
break;
}
default:
break;
}
Expand Down Expand Up @@ -70,28 +68,24 @@ void ReportPath(uv_handle_t* h, std::ostringstream& out) {
uv_any_handle* handle = reinterpret_cast<uv_any_handle*>(h);
// First call to get required buffer size.
switch (h->type) {
case UV_FS_EVENT: {
case UV_FS_EVENT:
rc = uv_fs_event_getpath(&(handle->fs_event), buffer.data, &size);
break;
}
case UV_FS_POLL: {
case UV_FS_POLL:
rc = uv_fs_poll_getpath(&(handle->fs_poll), buffer.data, &size);
break;
}
default:
break;
}
if (rc == UV_ENOBUFS) {
buffer = MallocedBuffer<char>(size);
switch (h->type) {
case UV_FS_EVENT: {
case UV_FS_EVENT:
rc = uv_fs_event_getpath(&(handle->fs_event), buffer.data, &size);
break;
}
case UV_FS_POLL: {
case UV_FS_POLL:
rc = uv_fs_poll_getpath(&(handle->fs_poll), buffer.data, &size);
break;
}
default:
break;
}
Expand Down Expand Up @@ -141,13 +135,12 @@ void WalkHandle(uv_handle_t* h, void* arg) {
}
break;
}
case UV_SIGNAL: {
case UV_SIGNAL:
// SIGWINCH is used by libuv so always appears.
// See http://docs.libuv.org/en/v1.x/signal.html
data << "signum: " << handle->signal.signum << " (" <<
node::signo_string(handle->signal.signum) << ")";
break;
}
default:
break;
}
Expand Down

0 comments on commit 8494a61

Please sign in to comment.