don't use pic_false_p if possible
This commit is contained in:
parent
f4efaf5dc0
commit
c57655c7ac
|
@ -174,12 +174,13 @@ static pic_value
|
|||
pic_lib_library_import(pic_state *pic)
|
||||
{
|
||||
const char *lib;
|
||||
pic_value name, alias = pic_false_value(pic), realname, uid;
|
||||
pic_value name, alias, realname, uid;
|
||||
struct pic_lib *libp;
|
||||
int n;
|
||||
|
||||
pic_get_args(pic, "zm|m", &lib, &name, &alias);
|
||||
n = pic_get_args(pic, "zm|m", &lib, &name, &alias);
|
||||
|
||||
if (pic_false_p(pic, alias)) {
|
||||
if (n == 2) {
|
||||
alias = name;
|
||||
}
|
||||
|
||||
|
@ -205,10 +206,11 @@ static pic_value
|
|||
pic_lib_library_export(pic_state *pic)
|
||||
{
|
||||
pic_value name, alias = pic_false_value(pic);
|
||||
int n;
|
||||
|
||||
pic_get_args(pic, "m|m", &name, &alias);
|
||||
n = pic_get_args(pic, "m|m", &name, &alias);
|
||||
|
||||
if (pic_false_p(pic, alias)) {
|
||||
if (n == 1) {
|
||||
alias = name;
|
||||
}
|
||||
|
||||
|
|
|
@ -561,12 +561,13 @@ pic_pair_memv(pic_state *pic)
|
|||
static pic_value
|
||||
pic_pair_member(pic_state *pic)
|
||||
{
|
||||
pic_value key, list, proc = pic_false_value(pic);
|
||||
pic_value key, list, proc;
|
||||
int n;
|
||||
|
||||
pic_get_args(pic, "oo|l", &key, &list, &proc);
|
||||
n = pic_get_args(pic, "oo|l", &key, &list, &proc);
|
||||
|
||||
while (! pic_nil_p(pic, list)) {
|
||||
if (pic_false_p(pic, proc)) {
|
||||
if (n == 2) {
|
||||
if (pic_equal_p(pic, key, pic_car(pic, list)))
|
||||
return list;
|
||||
} else {
|
||||
|
@ -615,13 +616,14 @@ pic_pair_assv(pic_state *pic)
|
|||
static pic_value
|
||||
pic_pair_assoc(pic_state *pic)
|
||||
{
|
||||
pic_value key, alist, proc = pic_false_value(pic), cell;
|
||||
pic_value key, alist, proc, cell;
|
||||
int n;
|
||||
|
||||
pic_get_args(pic, "oo|l", &key, &alist, &proc);
|
||||
n = pic_get_args(pic, "oo|l", &key, &alist, &proc);
|
||||
|
||||
while (! pic_nil_p(pic, alist)) {
|
||||
cell = pic_car(pic, alist);
|
||||
if (pic_false_p(pic, proc)) {
|
||||
if (n == 2) {
|
||||
if (pic_equal_p(pic, key, pic_car(pic, cell)))
|
||||
return cell;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue