nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src: migrate nitunits to annotations
[nit.git]
/
src
/
compiler
/
coloring.nit
diff --git
a/src/compiler/coloring.nit
b/src/compiler/coloring.nit
index
9b3748b
..
80f29ec
100644
(file)
--- a/
src/compiler/coloring.nit
+++ b/
src/compiler/coloring.nit
@@
-178,6
+178,9
@@
class POSetColorer[E: Object]
var is_colored = false
# Resulting ids
var is_colored = false
# Resulting ids
+ #
+ # All ids are strictly positive (`>= 1`).
+ #
# REQUIRE: is_colored
fun ids: Map[E, Int] do
assert is_colored
# REQUIRE: is_colored
fun ids: Map[E, Int] do
assert is_colored
@@
-223,7
+226,7
@@
class POSetColorer[E: Object]
ids_cache.clear
var elements = new HashSet[E].from(poset_cache.to_a)
for e in poset_cache.linearize(elements) do
ids_cache.clear
var elements = new HashSet[E].from(poset_cache.to_a)
for e in poset_cache.linearize(elements) do
- ids_cache[e] = ids_cache.length
+ ids_cache[e] = ids_cache.length + 1
end
end
end
end