1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

Remove useless casts

Casting the argument of strVal() to (Value *) is useless, since
strVal() already does that.

Most code didn't do that anyway; this was apparently just a style that
snuck into certain files.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/5ba6bc5b-3f95-04f2-2419-f8ddb4c046fb@enterprisedb.com
This commit is contained in:
Peter Eisentraut
2021-09-09 07:58:12 +02:00
parent 3b231596cc
commit cbdf75bf80
5 changed files with 28 additions and 28 deletions

View File

@ -255,7 +255,7 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
{
case OBJECT_ACCESS_METHOD:
msg = gettext_noop("access method \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_TYPE:
case OBJECT_DOMAIN:
@ -285,7 +285,7 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
break;
case OBJECT_SCHEMA:
msg = gettext_noop("schema \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_STATISTIC_EXT:
if (!schema_does_not_exist_skipping(castNode(List, object), &msg, &name))
@ -324,7 +324,7 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
break;
case OBJECT_EXTENSION:
msg = gettext_noop("extension \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_FUNCTION:
{
@ -392,7 +392,7 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
}
case OBJECT_LANGUAGE:
msg = gettext_noop("language \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_CAST:
{
@ -434,7 +434,7 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
break;
case OBJECT_EVENT_TRIGGER:
msg = gettext_noop("event trigger \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_RULE:
if (!owningrel_does_not_exist_skipping(castNode(List, object), &msg, &name))
@ -447,11 +447,11 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
break;
case OBJECT_FDW:
msg = gettext_noop("foreign-data wrapper \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_FOREIGN_SERVER:
msg = gettext_noop("server \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
case OBJECT_OPCLASS:
{
@ -479,7 +479,7 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
break;
case OBJECT_PUBLICATION:
msg = gettext_noop("publication \"%s\" does not exist, skipping");
name = strVal((Value *) object);
name = strVal(object);
break;
default:
elog(ERROR, "unrecognized object type: %d", (int) objtype);