Skip to content

Commit

Permalink
Refactor out remaining calls to row_count
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Sep 6, 2014
1 parent 575e3e7 commit bf41db8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions core/bug_api.php
Expand Up @@ -741,7 +741,9 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors = true ) {
$t_query = 'SELECT * FROM {bug} WHERE id=' . db_param();
$t_result = db_query( $t_query, array( $c_bug_id ) );

if( 0 == db_num_rows( $t_result ) ) {
$t_row = db_fetch_array( $t_result );

if( !$t_row ) {
$g_cache_bug[$c_bug_id] = false;

if( $p_trigger_errors ) {
Expand All @@ -752,8 +754,6 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors = true ) {
}
}

$t_row = db_fetch_array( $t_result );

return bug_add_to_cache( $t_row );
}

Expand Down Expand Up @@ -845,7 +845,9 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors = true ) {
WHERE b.id=' . db_param() . ' AND b.bug_text_id = bt.id';
$t_result = db_query( $t_query, array( $c_bug_id ) );

if( 0 == db_num_rows( $t_result ) ) {
$t_row = db_fetch_array( $t_result );

if( !$t_row ) {
$g_cache_bug_text[$c_bug_id] = false;

if( $p_trigger_errors ) {
Expand All @@ -856,8 +858,6 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors = true ) {
}
}

$t_row = db_fetch_array( $t_result );

$g_cache_bug_text[$c_bug_id] = $t_row;

return $t_row;
Expand Down
6 changes: 3 additions & 3 deletions core/filter_api.php
Expand Up @@ -4431,7 +4431,9 @@ function filter_cache_row( $p_filter_id, $p_trigger_errors = true ) {
$t_query = 'SELECT * FROM {filters} WHERE id=' . db_param();
$t_result = db_query( $t_query, array( $p_filter_id ) );

if( 0 == db_num_rows( $t_result ) ) {
$t_row = db_fetch_array( $t_result );

if( !$t_row ) {
if( $p_trigger_errors ) {
error_parameters( $p_filter_id );
trigger_error( ERROR_FILTER_NOT_FOUND, ERROR );
Expand All @@ -4440,8 +4442,6 @@ function filter_cache_row( $p_filter_id, $p_trigger_errors = true ) {
}
}

$t_row = db_fetch_array( $t_result );

$g_cache_filter[$p_filter_id] = $t_row;

return $t_row;
Expand Down

0 comments on commit bf41db8

Please sign in to comment.