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

Commit1267d98

Browse files
committed
Remove useless Asserts in Result Cache code
Testing if an unsigned variable is >= 0 is pretty pointless.There's likely enough code in remove_cache_entry() to verify the cachememory accounting is correct in assert enabled builds. These Assertswere not adding much extra cover, even if they had been checking >= 0 on asigned variable.Reported-by: Andres FreundDiscussion:https://postgr.es/m/20210402204734.6mo3nfacnljlicgn@alap3.anarazel.de
1 parent84bc2b1 commit1267d98

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

‎src/backend/executor/nodeResultCache.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ entry_purge_tuples(ResultCacheState *rcstate, ResultCacheEntry *entry)
286286

287287
/* Update the memory accounting */
288288
rcstate->mem_used-=freed_mem;
289-
290-
Assert(rcstate->mem_used >=0);
291289
}
292290

293291
/*
@@ -346,8 +344,6 @@ remove_cache_entry(ResultCacheState *rcstate, ResultCacheEntry *entry)
346344
*/
347345
rcstate->mem_used-=EMPTY_ENTRY_MEMORY_BYTES(entry);
348346

349-
Assert(rcstate->mem_used >=0);
350-
351347
/* Remove the entry from the cache */
352348
resultcache_delete_item(rcstate->hashtable,entry);
353349

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp