(util_msgset): Added some comments
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -292,11 +292,13 @@ util_msgset (char *s, size_t **set, int *n, int isuid) | ... | @@ -292,11 +292,13 @@ util_msgset (char *s, size_t **set, int *n, int isuid) |
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
295 | /* Sort the resulting message set */ | ||
295 | qsort (*set, *n, sizeof (**set), comp_int); | 296 | qsort (*set, *n, sizeof (**set), comp_int); |
296 | 297 | ||
298 | /* Remove duplicates. tmp serves to avoid extra dereferences */ | ||
297 | tmp = *set; | 299 | tmp = *set; |
298 | for (i = 0, j = 1; i < *n; i++) | 300 | for (i = 0, j = 1; i < *n; i++) |
299 | if (tmp[j-1] != (*set)[i]) | 301 | if (tmp[j-1] != tmp[i]) |
300 | tmp[j++] = tmp[i]; | 302 | tmp[j++] = tmp[i]; |
301 | *n = j; | 303 | *n = j; |
302 | return 0; | 304 | return 0; | ... | ... |
-
Please register or sign in to post a comment