mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
intl extension couple of micro optimisations for error edge cases. (#10044)
making c++ compile time few enums ranges.
This commit is contained in:
parent
9788244a42
commit
690db97c6d
10 changed files with 32 additions and 32 deletions
|
@ -23,7 +23,7 @@ extern "C" {
|
|||
/* {{{ intl_stringFromChar */
|
||||
int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status)
|
||||
{
|
||||
if(str_len > INT32_MAX) {
|
||||
if(UNEXPECTED(str_len > INT32_MAX)) {
|
||||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
ret.setToBogus();
|
||||
return FAILURE;
|
||||
|
@ -56,7 +56,7 @@ zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status)
|
|||
{
|
||||
zend_string *u8res;
|
||||
|
||||
if (from.isBogus()) {
|
||||
if (UNEXPECTED(from.isBogus())) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue