pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2014-08-26
2014-08-26 09:01:13 by Stephen R. van den Berg <srb@cuci.nl>
d398fced4790058d1f161fdabce3ba8e863c1700 (
21
lines) (+
7
/-
14
)
[
Show
|
Annotate
]
Branch:
8.0
Eliminate superfluous type check.
2617:
PIKEFUN mixed `[](int index, int|void end_or_none) { INT_TYPE end = index;
-
INT32 numargs =
0
;
+
INT32 numargs =
3
;
INT32 i;
-
if (THIS->args)
{
-
numargs = THIS->args->size;
-
}
+
if (THIS->args)
+
numargs
+
= THIS->args->size;
-
numargs += 3;
-
+
if (!end_or_none) {
-
if (index < 0)
{
+
if (index < 0)
index_error("pike_frame->`[]", Pike_sp-args, args, NULL, Pike_sp-args, "Indexing with negative index (%"PRINTPIKEINT"d)\n", index);
-
}
else if (index >= numargs)
{
+
else if (index >= numargs)
index_error("pike_frame->`[]", Pike_sp-args, args, NULL, Pike_sp-args, "Indexing with too large index (%"PRINTPIKEINT"d)\n", index);
-
}
-
}
else
{
-
if (TYPEOF(*end_or_none) != PIKE_T_INT) {
-
SIMPLE_BAD_ARG_ERROR("`[]",2,"int|void");
-
}
+
} else
end = end_or_none->u.integer;
-
}
+
pop_n_elems(args);