eslint: Fix unicorn/no-lonely-if.

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v24.0.0/docs/rules/no-lonely-if.md

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-12-22 02:26:39 -08:00
committed by Tim Abbott
parent 6acbcec39d
commit 2f80415756
23 changed files with 223 additions and 247 deletions

View File

@@ -69,10 +69,8 @@ exports.get_messages_in_topic = function (stream_id, topic) {
exports.get_max_message_id_in_stream = function (stream_id) {
let max_message_id = 0;
for (const msg of message_list.all.all_messages()) {
if (msg.type === "stream" && msg.stream_id === stream_id) {
if (msg.id > max_message_id) {
max_message_id = msg.id;
}
if (msg.type === "stream" && msg.stream_id === stream_id && msg.id > max_message_id) {
max_message_id = msg.id;
}
}
return max_message_id;