pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2012-05-08
2012-05-08 22:52:32 by Arne Goedeke <el@laramies.com>
dcb5ab554b273e865a31ce58cf8ecc12cb4d9c1c (
13
lines) (+
10
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
ADT.List: fixed iterators and tail()
4375:
*/ PIKEFUN mixed tail() {
-
if (THIS->
tail
->
prev
) {
-
push_svalue(&
THIS
->
tail
->val);
+
struct pike_list_node * node = TAIL_SENTINEL(THIS);
+
if (THIS->
head
->
next
) {
+
push_svalue(&
node
->
prev
->val);
} else { Pike_error("Empty list.\n"); }
4482:
loc.o = Pike_fp->current_object; loc.parent_identifier = Pike_fp->fun;
+
if (loc.parent_identifier == FUNCTION_BUILTIN) {
+
loc.inherit = loc.o->prog->inherits
+
+ loc.o->prog->num_inherits - 1;
+
} else {
loc.inherit = INHERIT_FROM_INT(loc.o->prog, loc.parent_identifier);
-
+
}
find_external_context(&loc, 1); return (struct List_struct *)(loc.o->storage + loc.inherit->storage_offset);