projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcf753a
)
CLEANUP: Replace for loop with only a condition by while
author
Tim Duesterhus
<tim@bastelstu.be>
Thu, 4 Mar 2021 22:50:13 +0000
(23:50 +0100)
committer
Willy Tarreau
<w@1wt.eu>
Fri, 5 Mar 2021 07:28:53 +0000
(08:28 +0100)
Refactoring performed with the following Coccinelle patch:
@@
expression e;
statement S;
@@
- for (;e;)
+ while (e)
S
src/h2.c
patch
|
blob
|
history
diff --git
a/src/h2.c
b/src/h2.c
index
84aa660
..
9ff3c93
100644
(file)
--- a/
src/h2.c
+++ b/
src/h2.c
@@
-535,7
+535,7
@@
int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms
* insert "; " before the new value.
*/
fs += tl; // first one is already counted
- for (; (ck = list[ck].n.len) >= 0 ; ) {
+ while ((ck = list[ck].n.len) >= 0) {
vl = list[ck].v.len;
tl += vl + 2;
if (tl > fs)