mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-17 19:11:00 -05:00
Replace all 'sizeof(x)/sizeof(*x)' with lenof.
I noticed a few of these in the course of preparing the previous commit. I must have been writing that idiom out by hand for _ages_ before it became totally habitual to #define it as 'lenof' in every codebase I touch. Now I've gone through and replaced all the old verbosity with nice terse lenofs.
This commit is contained in:
@ -510,7 +510,7 @@ static void zlib_match(struct LZ77Context *ectx, int distance, int len)
|
||||
* transmitting.
|
||||
*/
|
||||
i = -1;
|
||||
j = sizeof(lencodes) / sizeof(*lencodes);
|
||||
j = lenof(lencodes);
|
||||
while (1) {
|
||||
assert(j - i >= 2);
|
||||
k = (j + i) / 2;
|
||||
@ -546,7 +546,7 @@ static void zlib_match(struct LZ77Context *ectx, int distance, int len)
|
||||
* transmitting.
|
||||
*/
|
||||
i = -1;
|
||||
j = sizeof(distcodes) / sizeof(*distcodes);
|
||||
j = lenof(distcodes);
|
||||
while (1) {
|
||||
assert(j - i >= 2);
|
||||
k = (j + i) / 2;
|
||||
|
Reference in New Issue
Block a user