aboutsummaryrefslogtreecommitdiff
path: root/library/lib.ml
diff options
context:
space:
mode:
authorletouzey2013-02-18 13:57:09 +0000
committerletouzey2013-02-18 13:57:09 +0000
commit648c594489f8d0ffdde9596b87f5c1ff6ccef612 (patch)
tree8fef1eb15cad0a445ba9a07fe9f0f4c06febe727 /library/lib.ml
parent5d777a578b2973f57dffa9ca38d76bfda0551498 (diff)
Minor code cleanups, especially take advantage of Dir_path.is_empty
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16210 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library/lib.ml')
-rw-r--r--library/lib.ml22
1 files changed, 7 insertions, 15 deletions
diff --git a/library/lib.ml b/library/lib.ml
index 01e24f6c78..191b00ea92 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -693,38 +693,30 @@ let remove_section_part ref =
(************************)
(* Discharging names *)
-let pop_kn kn =
- let (mp,dir,l) = Names.repr_mind kn in
- Names.make_mind mp (pop_dirpath dir) l
-
-let pop_con con =
- let (mp,dir,l) = Names.repr_con con in
- Names.make_con mp (pop_dirpath dir) l
-
let con_defined_in_sec kn =
let _,dir,_ = Names.repr_con kn in
- not (Names.Dir_path.equal dir Names.Dir_path.empty) &&
+ not (Names.Dir_path.is_empty dir) &&
Names.Dir_path.equal (fst (split_dirpath dir)) (snd (current_prefix ()))
let defined_in_sec kn =
let _,dir,_ = Names.repr_mind kn in
- not (Names.Dir_path.equal dir Names.Dir_path.empty) &&
+ not (Names.Dir_path.is_empty dir) &&
Names.Dir_path.equal (fst (split_dirpath dir)) (snd (current_prefix ()))
let discharge_global = function
| ConstRef kn when con_defined_in_sec kn ->
- ConstRef (pop_con kn)
+ ConstRef (Globnames.pop_con kn)
| IndRef (kn,i) when defined_in_sec kn ->
- IndRef (pop_kn kn,i)
+ IndRef (Globnames.pop_kn kn,i)
| ConstructRef ((kn,i),j) when defined_in_sec kn ->
- ConstructRef ((pop_kn kn,i),j)
+ ConstructRef ((Globnames.pop_kn kn,i),j)
| r -> r
let discharge_kn kn =
- if defined_in_sec kn then pop_kn kn else kn
+ if defined_in_sec kn then Globnames.pop_kn kn else kn
let discharge_con cst =
- if con_defined_in_sec cst then pop_con cst else cst
+ if con_defined_in_sec cst then Globnames.pop_con cst else cst
let discharge_inductive (kn,i) =
(discharge_kn kn,i)