nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f17a953
)
lib: fix Counter::clear
author
Alexandre Terrasa
<alexandre@moz-code.org>
Tue, 25 Mar 2014 21:21:08 +0000
(17:21 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 25 Apr 2014 01:56:13 +0000
(21:56 -0400)
Now the sum is also set to 0 when call to clear
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/counter.nit
patch
|
blob
|
history
diff --git
a/lib/counter.nit
b/lib/counter.nit
index
2f16944
..
75278d2
100644
(file)
--- a/
lib/counter.nit
+++ b/
lib/counter.nit
@@
-52,7
+52,10
@@
class Counter[E: Object]
redef fun is_empty do return map.is_empty
- redef fun clear do map.clear
+ redef fun clear do
+ sum = 0
+ map.clear
+ end
# Count one more occurrence of `e`
fun inc(e: E)