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

Commit3f2adac

Browse files
committed
Fix end-of-loop optimization in pglz_find_match() function.
After the recent pglz optimization patch, the next/prev pointers in thehash table are never NULL, INVALID_ENTRY_PTR is used to represent invalidentries instead. The end-of-loop check in pglz_find_match() function didn'tget the memo. The result was the same from a correctness point of view, butbecause the NULL-check would never fail, the tiny optimization turned intoa pessimization.Reported by Stephen Frost, using Coverity scanner.
1 parent750f436 commit3f2adac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/adt/pg_lzcompress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ pglz_find_match(int16 *hstart, const char *input, const char *end,
466466
* Be happy with lesser good matches the more entries we visited. But
467467
* no point in doing calculation if we're at end of list.
468468
*/
469-
if (hent)
469+
if (hent!=INVALID_ENTRY_PTR)
470470
{
471471
if (len >=good_match)
472472
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp