Skip to content

Commit

Permalink
Only lookup the version when changed
Browse files Browse the repository at this point in the history
As suggested by @vboctor during review, there is no point in checking
the version if it has not been modified.

Issue #27363
  • Loading branch information
dregad committed Dec 30, 2020
1 parent 14639fe commit 35fdf03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bug_update.php
Expand Up @@ -70,8 +70,10 @@
* @return string|null
*/
function get_valid_version( BugData $p_bug, $p_field ) {
$t_version = gpc_get_string( $p_field, $p_bug->$p_field );
$t_reference_version = $p_bug->$p_field;
$t_version = gpc_get_string( $p_field, $t_reference_version );
if( !is_blank( $t_version )
&& $t_version != $t_reference_version
&& version_get_id( $t_version, $p_bug->project_id ) === false
) {
error_parameters( $t_version );
Expand Down

0 comments on commit 35fdf03

Please sign in to comment.