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

Commit8d30337

Browse files
committed
Fix up bad layout of some comments (probably pg_indent's fault), and
improve grammar a tad. Per Greg Stark.
1 parent087a271 commit8d30337

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

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

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
*
167167
* Copyright (c) 1999-2007, PostgreSQL Global Development Group
168168
*
169-
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_lzcompress.c,v 1.26 2007/04/06 04:21:43 tgl Exp $
169+
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_lzcompress.c,v 1.27 2007/08/0421:53:00 tgl Exp $
170170
* ----------
171171
*/
172172
#include"postgres.h"
@@ -211,29 +211,27 @@ typedef struct PGLZ_HistEntry
211211
* ----------
212212
*/
213213
staticconstPGLZ_Strategystrategy_default_data= {
214-
256,/* Data chunks smaller 256 bytes are not
215-
* compressed */
216-
6144,/* Data chunks greater equal 6K force
217-
* compression */
218-
/* except compressed result is greater uncompressed data*/
219-
20,/* Compression rates below 20% mean fallback
220-
* to uncompressed */
221-
/* storage except compression is forced by previous parameter*/
214+
256,/* Data chunks less than 256 bytes are not
215+
* compressed */
216+
6144,/* Data chunks >= 6K force compression, unless
217+
* compressed output is larger than input */
218+
20,/* Below 6K, compression rates below 20% mean
219+
* fallback to uncompressed */
222220
128,/* Stop history lookup if a match of 128 bytes
223-
* is found*/
221+
* is found*/
224222
10/* Lower good match size by 10% at every
225-
* lookup loop iteration. */
223+
* lookup loop iteration */
226224
};
227225
constPGLZ_Strategy*constPGLZ_strategy_default=&strategy_default_data;
228226

229227

230228
staticconstPGLZ_Strategystrategy_always_data= {
231-
0,/* Chunks of any size are compressed*/
232-
0,/* */
233-
0,/*We want to saveat leastone single byte*/
229+
0,/* Chunks of any size are compressed*/
230+
0,
231+
0,/*It's enough to save one single byte*/
234232
128,/* Stop history lookup if a match of 128 bytes
235-
* is found*/
236-
6/* Look harder for a good match.*/
233+
* is found*/
234+
6/* Look harder for a good match*/
237235
};
238236
constPGLZ_Strategy*constPGLZ_strategy_always=&strategy_always_data;
239237

@@ -511,7 +509,7 @@ pglz_compress(const char *source, int32 slen, PGLZ_Header *dest,
511509
* If the strategy forbids compression (at all or if source chunk too
512510
* small), fail.
513511
*/
514-
if (strategy->match_size_good==0||
512+
if (strategy->match_size_good<=0||
515513
slen<strategy->min_input_size)
516514
return false;
517515

‎src/include/utils/pg_lzcompress.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
*Definitions for the builtin LZ compressor
55
*
6-
* $PostgreSQL: pgsql/src/include/utils/pg_lzcompress.h,v 1.14 2007/02/27 23:48:10 tgl Exp $
6+
* $PostgreSQL: pgsql/src/include/utils/pg_lzcompress.h,v 1.15 2007/08/04 21:53:00 tgl Exp $
77
* ----------
88
*/
99

@@ -50,16 +50,18 @@ typedef struct PGLZ_Header
5050
*
5151
*min_input_sizeMinimum input data size to start compression.
5252
*
53-
*force_input_sizeInput data size at which compressed storage is
54-
*forced even if the compression rate drops below
55-
*min_comp_rate (but not below 0).
56-
*
57-
*min_comp_rateMinimum compression rate (0-99%), the output
58-
*must be smaller than the input. If that isn't
53+
*force_input_sizeMinimum input data size to force compression
54+
*even if the compression rate drops below
55+
*min_comp_rate. But in any case the output
56+
*must be smaller than the input. If that isn't
5957
*the case, the compressor will throw away its
6058
*output and copy the original, uncompressed data
6159
*to the output buffer.
6260
*
61+
*min_comp_rateMinimum compression rate (0-99%) to require for
62+
*inputs smaller than force_input_size. If not
63+
*achieved, the output will be uncompressed.
64+
*
6365
*match_size_goodThe initial GOOD match size when starting history
6466
*lookup. When looking up the history to find a
6567
*match that could be expressed as a tag, the
@@ -70,8 +72,8 @@ typedef struct PGLZ_Header
7072
*longer the lookup takes, the smaller matches
7173
*are considered good.
7274
*
73-
*match_size_dropThe percentage, match_size_good is lowered
74-
*at each history check. Allowed values are
75+
*match_size_dropThe percentage by which match_size_good is lowered
76+
*after each history check. Allowed values are
7577
*0 (no change until end) to 100 (only check
7678
*latest history entry at all).
7779
* ----------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp