nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
827dad8
)
model/model_views: search mentity by full_name
author
Alexandre Terrasa
<alexandre@moz-code.org>
Thu, 19 May 2016 23:32:13 +0000
(19:32 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Thu, 19 May 2016 23:32:13 +0000
(19:32 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
src/model/model_views.nit
patch
|
blob
|
history
diff --git
a/src/model/model_views.nit
b/src/model/model_views.nit
index
f130f09
..
566a5bd
100644
(file)
--- a/
src/model/model_views.nit
+++ b/
src/model/model_views.nit
@@
-132,6
+132,14
@@
class ModelView
return res
end
+ # Searches the MEntity that matches `full_name`.
+ fun mentity_by_full_name(full_name: String): nullable MEntity do
+ for mentity in mentities do
+ if mentity.full_name == full_name then return mentity
+ end
+ return null
+ end
+
# Looks up a MEntity by its full `namespace`.
#
# Usefull when `mentities_by_name` returns conflicts.