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

Commit01d1074

Browse files
committed
beautify code in pathman_cache_search_relid()
1 parent04ca436 commit01d1074

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
HASHACTIONaction,
116116
bool*found)
117117
{
118-
switch (action)
119-
{
120-
caseHASH_FIND:
121-
caseHASH_REMOVE:
122-
caseHASH_ENTER:
123-
if (!cache_table)
118+
/* Table is NULL, take some actions */
119+
if (cache_table==NULL)
120+
switch (action)
121+
{
122+
caseHASH_FIND:
123+
caseHASH_ENTER:
124+
caseHASH_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
returnhash_search(cache_table, (constvoid*)&relid,action,found);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp