except: add expect conditions for try_code
This commit is contained in:
parent
9445b29bd3
commit
07885819e3
@ -60,7 +60,7 @@ errno_error::try_code (void)
|
||||
void
|
||||
errno_error::try_code (int code)
|
||||
{
|
||||
if (code != 0)
|
||||
if (__builtin_expect (code != 0, false))
|
||||
throw errno_error(code);
|
||||
}
|
||||
|
||||
@ -117,9 +117,7 @@ win32_error::try_code (void)
|
||||
void
|
||||
win32_error::try_code (DWORD id)
|
||||
{
|
||||
if (id == ERROR_SUCCESS)
|
||||
return;
|
||||
|
||||
if (__builtin_expect (id != ERROR_SUCCESS, false))
|
||||
throw_code (id);
|
||||
}
|
||||
|
||||
|
@ -89,9 +89,7 @@ net::error::throw_code (void)
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
net::error::try_code (int err) {
|
||||
if (err == 0)
|
||||
return;
|
||||
|
||||
if (__builtin_expect (err != 0, false))
|
||||
throw_code (err);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user