summaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorPeter Eisentraut2025-12-02 09:05:12 +0000
committerPeter Eisentraut2025-12-02 09:09:32 +0000
commit4f941d432b42eccd99ba0d22e3a59c073ac2406a (patch)
tree0d9b07faff2842d0fe07a39d761b2fd0ac99ab89 /src/backend/optimizer
parent35988b31db7767ba446009611b9928add1d40f98 (diff)
Remove useless casting to same type
This removes some casts where the input already has the same type as the type specified by the cast. Their presence could cause risks of hiding actual type mismatches in the future or silently discarding qualifiers. It also improves readability. Same kind of idea as 7f798aca1d5 and ef8fe693606. (This does not change all such instances, but only those hand-picked by the author.) Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://www.postgresql.org/message-id/flat/aSQy2JawavlVlEB0%40ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/geqo/geqo_pool.c4
-rw-r--r--src/backend/optimizer/plan/planner.c4
-rw-r--r--src/backend/optimizer/util/pathnode.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c
index b6de0d93f28..89e3d6a0277 100644
--- a/src/backend/optimizer/geqo/geqo_pool.c
+++ b/src/backend/optimizer/geqo/geqo_pool.c
@@ -47,8 +47,8 @@ alloc_pool(PlannerInfo *root, int pool_size, int string_length)
/* pool */
new_pool = (Pool *) palloc(sizeof(Pool));
- new_pool->size = (int) pool_size;
- new_pool->string_length = (int) string_length;
+ new_pool->size = pool_size;
+ new_pool->string_length = string_length;
/* all chromosome */
new_pool->data = (Chromosome *) palloc(pool_size * sizeof(Chromosome));
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index c4fd646b999..0e78628bf01 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -3949,7 +3949,7 @@ make_grouping_rel(PlannerInfo *root, RelOptInfo *input_rel,
* target list and HAVING quals are parallel-safe.
*/
if (input_rel->consider_parallel && target_parallel_safe &&
- is_parallel_safe(root, (Node *) havingQual))
+ is_parallel_safe(root, havingQual))
grouped_rel->consider_parallel = true;
/*
@@ -8525,7 +8525,7 @@ create_unique_paths(PlannerInfo *root, RelOptInfo *rel, SpecialJoinInfo *sjinfo)
tle = tlist_member(uniqexpr, newtlist);
if (!tle)
{
- tle = makeTargetEntry((Expr *) uniqexpr,
+ tle = makeTargetEntry(uniqexpr,
nextresno,
NULL,
false);
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index fd4bd5f93f0..b6be4ddbd01 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -3865,7 +3865,7 @@ reparameterize_path(PlannerInfo *root, Path *path,
case T_SeqScan:
return create_seqscan_path(root, rel, required_outer, 0);
case T_SampleScan:
- return (Path *) create_samplescan_path(root, rel, required_outer);
+ return create_samplescan_path(root, rel, required_outer);
case T_IndexScan:
case T_IndexOnlyScan:
{