Function renaming and moving.
This commit is contained in:
6 files changed
+48
-47
No files matched your search
@@ -65,23 +65,23 @@ static int visit_and_mark(int128_t a, int128_t b, int128_t c) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static Node *q_front = NULL;
|
||||
static Node *q_back = NULL;
|
||||
static Node *queue_front = NULL;
|
||||
static Node *queue_back = NULL;
|
||||
|
||||
static void enqueue(Node *n) {
|
||||
n->next = NULL;
|
||||
if (!q_back) q_front = q_back = n;
|
||||
if (!queue_back) queue_front = queue_back = n;
|
||||
else {
|
||||
q_back->next = n;
|
||||
q_back = n;
|
||||
queue_back->next = n;
|
||||
queue_back = n;
|
||||
}
|
||||
}
|
||||
|
||||
static Node *dequeue(void) {
|
||||
if (!q_front) return NULL;
|
||||
Node *r = q_front;
|
||||
q_front = q_front->next;
|
||||
if (!q_front) q_back = NULL;
|
||||
if (!queue_front) return NULL;
|
||||
Node *r = queue_front;
|
||||
queue_front = queue_front->next;
|
||||
if (!queue_front) queue_back = NULL;
|
||||
r->next = NULL;
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user