Skip to content

Commit d3e4703

Browse files
authored
[standard] Simply if -> RETURN_TRUE/FALSE with RETURN_BOOL() (phpGH-21147)
1 parent 51158bb commit d3e4703

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

ext/standard/dns_win32.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ PHP_FUNCTION(dns_check_record)
116116

117117
status = DnsQuery_A(hostname, type, DNS_QUERY_STANDARD, NULL, &pResult, NULL);
118118

119-
if (status) {
120-
RETURN_FALSE;
121-
}
122-
123-
RETURN_TRUE;
119+
RETURN_BOOL(!status);
124120
}
125121
/* }}} */
126122

ext/standard/file.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,10 +1016,8 @@ PHPAPI PHP_FUNCTION(fflush)
10161016
ZEND_PARSE_PARAMETERS_END();
10171017

10181018
ret = php_stream_flush(stream);
1019-
if (ret) {
1020-
RETURN_FALSE;
1021-
}
1022-
RETURN_TRUE;
1019+
1020+
RETURN_BOOL(!ret);
10231021
}
10241022
/* }}} */
10251023

@@ -1032,10 +1030,7 @@ PHPAPI PHP_FUNCTION(rewind)
10321030
PHP_Z_PARAM_STREAM(stream)
10331031
ZEND_PARSE_PARAMETERS_END();
10341032

1035-
if (-1 == php_stream_rewind(stream)) {
1036-
RETURN_FALSE;
1037-
}
1038-
RETURN_TRUE;
1033+
RETURN_BOOL(-1 != php_stream_rewind(stream));
10391034
}
10401035
/* }}} */
10411036

0 commit comments

Comments
 (0)