chiark
/
gitweb
/
~mdw
/
adns
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
991b3d5
)
src/types.c: Clarify addr_rrtypeflag loop (style)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 12 Oct 2014 19:34:42 +0000
(20:34 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 19 Oct 2014 20:16:23 +0000
(21:16 +0100)
This structure avoids repeating the loop termination condition.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/types.c
patch
|
blob
|
blame
|
history
diff --git
a/src/types.c
b/src/types.c
index 55a7709373532421d31f4363bf7f54e3e6531f3c..5062c6a8a35964c6bbc712fc4d6831001d61523b 100644
(file)
--- a/
src/types.c
+++ b/
src/types.c
@@
-373,8
+373,10
@@
static unsigned addr_rrtypeflag(adns_rrtype type) {
int i;
type &= adns_rrt_typemask;
- for (i=0; i<addr_nrrtypes && type!=addr_all_rrtypes[i]; i++);
- return i < addr_nrrtypes ? 1 << i : 0;
+ for (i=0; i<addr_nrrtypes; i++)
+ if (type==addr_all_rrtypes[i])
+ return 1 << i;
+ return 0;
}
/* About CNAME handling in addr queries.