]> granicus.if.org Git - postgresql/commit
Remove dead NULL-pointer checks in GiST code.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 28 Jan 2015 07:47:39 +0000 (09:47 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 28 Jan 2015 08:03:58 +0000 (10:03 +0200)
commit670bf71f65c2315fc2ea7265d540402093db8cef
treee77a2a457ceac76e75b787950e8d58fe9aa72a48
parent1a2b2034d48d46ec3d128b167cb7df317b4cd49a
Remove dead NULL-pointer checks in GiST code.

gist_poly_compress() and gist_circle_compress() checked for a NULL-pointer
key argument, but that was dead code; the gist code never passes a
NULL-pointer to the "compress" method.

This commit also removes a documentation note added in commit a0a3883,
about doing NULL-pointer checks in the "compress" method. It was added
based on the fact that some implementations were doing NULL-pointer
checks, but those checks were unnecessary in the first place.

The NULL-pointer check in gbt_var_same() function was also unnecessary.
The arguments to the "same" method come from the "compress", "union", or
"picksplit" methods, but none of them return a NULL pointer.

None of this is to be confused with SQL NULL values. Those are dealt with
by the gist machinery, and are never passed to the GiST opclass methods.

Michael Paquier
contrib/btree_gist/btree_utils_num.c
contrib/btree_gist/btree_utils_var.c
doc/src/sgml/gist.sgml
src/backend/access/gist/gistproc.c