core: fix warnings in abstract_collection
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 20 Apr 2016 05:38:41 +0000 (01:38 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 26 May 2016 21:52:30 +0000 (17:52 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/core/collection/abstract_collection.nit

index 5cffbec..5ed911f 100644 (file)
@@ -457,7 +457,9 @@ interface Set[E]
                var res = 23 + length
                # Note: the order of the elements must not change the hash value.
                # So, unlike usual hash functions, the accumulator is not combined with itself.
-               for e in self do res += e.hash
+               for e in self do
+                       if e != null then res += e.hash
+               end
                return res
        end