Commit 781975d4 by John Doe

fixed bug on sorting code

parent 95eb4833
Showing with 2 additions and 2 deletions
...@@ -42,12 +42,12 @@ class LoadElementData ...@@ -42,12 +42,12 @@ class LoadElementData
@end_time = end_time @end_time = end_time
if start_time == nil if start_time == nil
@start_time = streams_with_data @start_time = streams_with_data
.sort{|a,b| a.start_time < b.start_time } .sort_by{|x| x.start_time}
.first.start_time .first.start_time
end end
if end_time == nil if end_time == nil
@end_time = streams_with_data @end_time = streams_with_data
.sort{|a,b| a.end_time > b.end_time } .sort_by{|x| -1*x.end_time}
.first.end_time .first.end_time
end end
if @start_time > @end_time if @start_time > @end_time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment