Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
Metrics
Onionoo
Commits
ec16e791
Commit
ec16e791
authored
Aug 20, 2018
by
Karsten Loesing
Browse files
Replace Comparator with lambda.
parent
ed0097f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
View file @
ec16e791
...
...
@@ -27,16 +27,14 @@ public class WeightsStatus extends Document {
this
.
isDirty
=
false
;
}
private
Comparator
<
long
[]>
histComparator
=
new
Comparator
<
long
[]>()
{
public
int
compare
(
long
[]
first
,
long
[]
second
)
{
int
relation
=
Long
.
compare
(
first
[
0
],
second
[
0
]);
if
(
0
!=
relation
)
{
return
relation
;
}
else
{
return
Long
.
compare
(
first
[
1
],
second
[
1
]);
}
}
};
private
Comparator
<
long
[]>
histComparator
=
(
first
,
second
)
->
{
int
relation
=
Long
.
compare
(
first
[
0
],
second
[
0
]);
if
(
0
!=
relation
)
{
return
relation
;
}
else
{
return
Long
.
compare
(
first
[
1
],
second
[
1
]);
}
};
private
SortedMap
<
long
[],
double
[]>
history
=
new
TreeMap
<>(
histComparator
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment