Better sorting syntax

Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
This commit is contained in:
John Molakvoæ 2020-07-07 11:40:06 +02:00 committed by Jan-Christoph Borchardt
commit 09445e82ba
No known key found for this signature in database
GPG key ID: CBD846FC845CBE17

View file

@ -121,10 +121,7 @@ export default {
// Sort options by response count
questionOptionsStats.sort((object1, object2) => {
if (object1.count === object2.count) {
return 0
}
return object1.count < object2.count ? 1 : -1
return object2.count - object1.count
})
// Fill percentage values