aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorletouzey2005-08-19 19:51:02 +0000
committerletouzey2005-08-19 19:51:02 +0000
commitbe6ee173206a929ad664ff507334ad5add7ad157 (patch)
treebfc3228af152a38598bc09798c5602d5e5953148 /kernel
parent66a2d880e14c1635f29cef0ad0113185cba29a18 (diff)
Sur le conseil de X.Leroy: x=[||] devient Array.length x=0
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@7305 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cbytegen.ml2
-rw-r--r--kernel/term.ml6
2 files changed, 4 insertions, 4 deletions
diff --git a/kernel/cbytegen.ml b/kernel/cbytegen.ml
index 40965d2f59..7877fbccbf 100644
--- a/kernel/cbytegen.ml
+++ b/kernel/cbytegen.ml
@@ -453,7 +453,7 @@ and compile_str_cst reloc sc sz cont =
let nargs = Array.length args in
comp_args compile_str_cst reloc args sz (Kmakeblock(nargs,tag) :: cont)
| Bconstruct_app(tag,nparams,arity,args) ->
- if args = [||] then code_construct tag nparams arity cont
+ if Array.length args = 0 then code_construct tag nparams arity cont
else
comp_app
(fun _ _ _ cont -> code_construct tag nparams arity cont)
diff --git a/kernel/term.ml b/kernel/term.ml
index e62b10b791..b86ac850cd 100644
--- a/kernel/term.ml
+++ b/kernel/term.ml
@@ -226,7 +226,7 @@ let mkLetIn (x,c1,t,c2) = LetIn (x,c1,t,c2)
(* We ensure applicative terms have at least one argument and the
function is not itself an applicative term *)
let mkApp (f, a) =
- if a=[||] then f else
+ if Array.length a = 0 then f else
match f with
| App (g, cl) -> App (g, Array.append cl a)
| _ -> App (f, a)
@@ -435,7 +435,7 @@ let rec collapse_appl c = match kind_of_term c with
let rec collapse_rec f cl2 = match kind_of_term f with
| App (g,cl1) -> collapse_rec g (Array.append cl1 cl2)
| Cast (c,_) when isApp c -> collapse_rec c cl2
- | _ -> if cl2 = [||] then f else mkApp (f,cl2)
+ | _ -> if Array.length cl2 = 0 then f else mkApp (f,cl2)
in
collapse_rec f cl
| _ -> c
@@ -451,7 +451,7 @@ let rec strip_head_cast c = match kind_of_term c with
let rec collapse_rec f cl2 = match kind_of_term f with
| App (g,cl1) -> collapse_rec g (Array.append cl1 cl2)
| Cast (c,_) -> collapse_rec c cl2
- | _ -> if cl2 = [||] then f else mkApp (f,cl2)
+ | _ -> if Array.length cl2 = 0 then f else mkApp (f,cl2)
in
collapse_rec f cl
| Cast (c,t) -> strip_head_cast c