Skip to content

Commit 01d1074

Browse files
committed
beautify code in pathman_cache_search_relid()
1 parent 04ca436 commit 01d1074

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/init.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,22 @@ pathman_cache_search_relid(HTAB *cache_table,
115115
HASHACTION action,
116116
bool *found)
117117
{
118-
switch (action)
119-
{
120-
case HASH_FIND:
121-
case HASH_REMOVE:
122-
case HASH_ENTER:
123-
if (!cache_table)
118+
/* Table is NULL, take some actions */
119+
if (cache_table == NULL)
120+
switch (action)
121+
{
122+
case HASH_FIND:
123+
case HASH_ENTER:
124+
case HASH_REMOVE:
124125
elog(ERROR, "pg_pathman is not initialized yet");
125-
break;
126-
127-
/* Something strange has just happened */
128-
default:
129-
elog(ERROR, "unexpected action in function "
130-
CppAsString(pathman_cache_search_relid));
131-
break;
132-
}
126+
break;
133127

134-
AssertArg(cache_table);
128+
/* Something strange has just happened */
129+
default:
130+
elog(ERROR, "unexpected action in function "
131+
CppAsString(pathman_cache_search_relid));
132+
break;
133+
}
135134

136135
/* Everything is fine */
137136
return hash_search(cache_table, (const void *) &relid, action, found);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy