projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Grading library files.
[pintos-anon]
/
src
/
lib
/
kernel
/
list.c
diff --git
a/src/lib/kernel/list.c
b/src/lib/kernel/list.c
index 173557680184707306e5c2816a564a550ef79f8a..ba4fae68bfe51919dc30a43007f634c2fa8d0474 100644
(file)
--- a/
src/lib/kernel/list.c
+++ b/
src/lib/kernel/list.c
@@
-232,8
+232,9
@@
list_remove (list_elem *elem)
list_elem *
list_pop_front (struct list *list)
{
list_elem *
list_pop_front (struct list *list)
{
- ASSERT (list != NULL);
- return list_remove (list_front (list));
+ list_elem *front = list_front (list);
+ list_remove (front);
+ return front;
}
/* Removes the back element from LIST and returns it.
}
/* Removes the back element from LIST and returns it.
@@
-241,8
+242,9
@@
list_pop_front (struct list *list)
list_elem *
list_pop_back (struct list *list)
{
list_elem *
list_pop_back (struct list *list)
{
- ASSERT (list != NULL);
- return list_remove (list_back (list));
+ list_elem *back = list_back (list);
+ list_remove (back);
+ return back;
}
/* Returns the front element in LIST.
}
/* Returns the front element in LIST.