cansniffer: simplify, avoiding else case indention
refactoring Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>pull/316/head
parent
d9368a6003
commit
93a6cd6dfb
11
cansniffer.c
11
cansniffer.c
|
|
@ -580,16 +580,15 @@ int handle_frame(int fd, long currcms)
|
||||||
pos = sniftab_index(cf.can_id);
|
pos = sniftab_index(cf.can_id);
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
/* CAN ID not existing */
|
/* CAN ID not existing */
|
||||||
if (idx < MAX_SLOTS) {
|
if (idx >= MAX_SLOTS) {
|
||||||
/* assign new slot */
|
|
||||||
pos = idx++;
|
|
||||||
rx_changed = true;
|
|
||||||
run_qsort = true;
|
|
||||||
} else {
|
|
||||||
/* informative exit */
|
/* informative exit */
|
||||||
perror("number of different CAN IDs exceeded MAX_SLOTS");
|
perror("number of different CAN IDs exceeded MAX_SLOTS");
|
||||||
return 0; /* quit */
|
return 0; /* quit */
|
||||||
}
|
}
|
||||||
|
/* assign new slot */
|
||||||
|
pos = idx++;
|
||||||
|
rx_changed = true;
|
||||||
|
run_qsort = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (cf.can_dlc == sniftab[pos].current.can_dlc)
|
if (cf.can_dlc == sniftab[pos].current.can_dlc)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue