-/* computes A\B */
-struct llist * llist_sorted_difference(struct llist_item *A,
- struct llist_item *B)
-{
- struct llist *ret;
- llist_init(&ret);
-
- while (A != NULL && B != NULL) {
- int cmp = memcmp(A->sha1, B->sha1, 20);
- if (!cmp) {
- A = A->next;
- B = B->next;
- continue;
- }
- if(cmp > 0) { /* we'll never find this B */
- B = B->next;
- continue;
- }
- /* A has the object, B doesn't */
- llist_insert_back(ret, A->sha1);
- A = A->next;
- }
- while (A != NULL) {
- llist_insert_back(ret, A->sha1);
- A = A->next;
- }
- return ret;
-}
-