Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita69b55c

Browse files
committed
Tidy-up unneeded NULL parameter checks from SQL function
This function is marked as strict, so we can safely remove the checkschecking for NULL input parameters.Author: David Rowley <dgrowleyml@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://postgr.es/m/CAApHDvqiN0+mbooUOSCDALc=GoM8DmTbCdvwnCwak6Wb2O1ZJA@mail.gmail.com
1 parent54ab748 commita69b55c

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

‎src/test/modules/test_bitmapset/test_bitmapset.c‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ test_bitmap_match(PG_FUNCTION_ARGS)
587587
* "min_value" is the minimal value used for the members, that will stand
588588
* up to a range of "max_range". "num_ops" defines the number of time each
589589
* operation is done. "seed" is a random seed used to calculate the member
590-
* values.
590+
* values. When "seed" is <= 0, a random seed will be chosen automatically.
591591
*
592592
* The return value is the number of times all operations have been executed.
593593
*/
@@ -600,25 +600,20 @@ test_random_operations(PG_FUNCTION_ARGS)
600600
Bitmapset*result=NULL;
601601
pg_prng_statestate;
602602
uint64seed=GetCurrentTimestamp();
603-
intnum_ops=5000;
604-
inttotal_ops=0;
605-
intmax_range=2000;
606-
intmin_value=0;
603+
intnum_ops;
604+
intmax_range;
605+
intmin_value;
607606
intmember;
608607
int*members;
609608
intnum_members=0;
609+
inttotal_ops=0;
610610

611-
if (!PG_ARGISNULL(0)&&PG_GETARG_INT32(0)>0)
611+
if (PG_GETARG_INT32(0)>0)
612612
seed=PG_GETARG_INT32(0);
613613

614-
if (!PG_ARGISNULL(1))
615-
num_ops=PG_GETARG_INT32(1);
616-
617-
if (!PG_ARGISNULL(2))
618-
max_range=PG_GETARG_INT32(2);
619-
620-
if (!PG_ARGISNULL(3))
621-
min_value=PG_GETARG_INT32(3);
614+
num_ops=PG_GETARG_INT32(1);
615+
max_range=PG_GETARG_INT32(2);
616+
min_value=PG_GETARG_INT32(3);
622617

623618
pg_prng_seed(&state,seed);
624619
members=palloc(sizeof(int)*num_ops);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp