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,10 +117,8 @@ win32_error::try_code (void)
|
||||
void
|
||||
win32_error::try_code (DWORD id)
|
||||
{
|
||||
if (id == ERROR_SUCCESS)
|
||||
return;
|
||||
|
||||
throw_code (id);
|
||||
if (__builtin_expect (id != ERROR_SUCCESS, false))
|
||||
throw_code (id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,10 +89,8 @@ net::error::throw_code (void)
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
net::error::try_code (int err) {
|
||||
if (err == 0)
|
||||
return;
|
||||
|
||||
throw_code (err);
|
||||
if (__builtin_expect (err != 0, false))
|
||||
throw_code (err);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user