Description:
fix bug on calculating best of each lanuage
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r438:1c02c7fc8a89 - - 1 file changed: 1 inserted, 1 deleted
@@ -155,25 +155,25 | |||
|
155 | 155 | end |
|
156 | 156 | end |
|
157 | 157 | |
|
158 | 158 | #process user_id |
|
159 | 159 | @by_lang.each do |lang,prop| |
|
160 | 160 | prop.each do |k,v| |
|
161 | 161 | v[:user] = User.exists?(v[:user_id]) ? User.find(v[:user_id]).full_name : "(NULL)" |
|
162 | 162 | end |
|
163 | 163 | end |
|
164 | 164 | |
|
165 | 165 | #sum into best |
|
166 | 166 | if @by_lang and @by_lang.first |
|
167 | - @best = @by_lang.first[1] | |
|
167 | + @best = @by_lang.first[1].clone | |
|
168 | 168 | @by_lang.each do |lang,prop| |
|
169 | 169 | if @best[:runtime][:value] >= prop[:runtime][:value] |
|
170 | 170 | @best[:runtime] = prop[:runtime] |
|
171 | 171 | @best[:runtime][:lang] = lang |
|
172 | 172 | end |
|
173 | 173 | if @best[:memory][:value] >= prop[:memory][:value] |
|
174 | 174 | @best[:memory] = prop[:memory] |
|
175 | 175 | @best[:memory][:lang] = lang |
|
176 | 176 | end |
|
177 | 177 | if @best[:length][:value] >= prop[:length][:value] |
|
178 | 178 | @best[:length] = prop[:length] |
|
179 | 179 | @best[:length][:lang] = lang |
You need to be logged in to leave comments.
Login now