- case 1:
- if(cumulative)
- return -cmpu64(na->in_packets, nb->in_packets) ?: na->i - nb->i;
- else
- return -cmpfloat(na->in_packets_rate, nb->in_packets_rate) ?: na->i - nb->i;
- case 2:
- if(cumulative)
- return -cmpu64(na->in_bytes, nb->in_bytes) ?: na->i - nb->i;
- else
- return -cmpfloat(na->in_bytes_rate, nb->in_bytes_rate) ?: na->i - nb->i;
- case 3:
- if(cumulative)
- return -cmpu64(na->out_packets, nb->out_packets) ?: na->i - nb->i;
- else
- return -cmpfloat(na->out_packets_rate, nb->out_packets_rate) ?: na->i - nb->i;
- case 4:
- if(cumulative)
- return -cmpu64(na->out_bytes, nb->out_bytes) ?: na->i - nb->i;
- else
- return -cmpfloat(na->out_bytes_rate, nb->out_bytes_rate) ?: na->i - nb->i;
- case 5:
- if(cumulative)
- return -cmpu64(na->in_packets + na->out_packets, nb->in_packets + nb->out_packets) ?: na->i - nb->i;
- else
- return -cmpfloat(na->in_packets_rate + na->out_packets_rate, nb->in_packets_rate + nb->out_packets_rate) ?: na->i - nb->i;
- case 6:
- if(cumulative)
- return -cmpu64(na->in_bytes + na->out_bytes, nb->in_bytes + nb->out_bytes) ?: na->i - nb->i;
- else
- return -cmpfloat(na->in_bytes_rate + na->out_bytes_rate, nb->in_bytes_rate + nb->out_bytes_rate) ?: na->i - nb->i;
- default:
- return strcmp(na->name, nb->name) ?: na->i - nb->i;
+ case 1:
+ if(cumulative) {
+ result = -cmpu64(na->in_packets, nb->in_packets);
+ } else {
+ result = -cmpfloat(na->in_packets_rate, nb->in_packets_rate);
+ }
+
+ break;
+
+ case 2:
+ if(cumulative) {
+ result = -cmpu64(na->in_bytes, nb->in_bytes);
+ } else {
+ result = -cmpfloat(na->in_bytes_rate, nb->in_bytes_rate);
+ }
+
+ break;
+
+ case 3:
+ if(cumulative) {
+ result = -cmpu64(na->out_packets, nb->out_packets);
+ } else {
+ result = -cmpfloat(na->out_packets_rate, nb->out_packets_rate);
+ }
+
+ break;
+
+ case 4:
+ if(cumulative) {
+ result = -cmpu64(na->out_bytes, nb->out_bytes);
+ } else {
+ result = -cmpfloat(na->out_bytes_rate, nb->out_bytes_rate);
+ }
+
+ break;
+
+ case 5:
+ if(cumulative) {
+ result = -cmpu64(na->in_packets + na->out_packets, nb->in_packets + nb->out_packets);
+ } else {
+ result = -cmpfloat(na->in_packets_rate + na->out_packets_rate, nb->in_packets_rate + nb->out_packets_rate);
+ }
+
+ break;
+
+ case 6:
+ if(cumulative) {
+ result = -cmpu64(na->in_bytes + na->out_bytes, nb->in_bytes + nb->out_bytes);
+ } else {
+ result = -cmpfloat(na->in_bytes_rate + na->out_bytes_rate, nb->in_bytes_rate + nb->out_bytes_rate);
+ }
+
+ break;
+
+ default:
+ result = strcmp(na->name, nb->name);
+ break;
+ }
+
+ if(result) {
+ return result;
+ } else {
+ return na->i - nb->i;