Convert three assignment statements to the usage of compound operators
👀 Some source code analysis tools can help to find opportunities for improving software components.
💭 I propose to increase the usage of compound operators accordingly.
diff --git a/src/accountsMonitor.js b/src/accountsMonitor.js
index 685916d8..d0d21ca8 100644
--- a/src/accountsMonitor.js
+++ b/src/accountsMonitor.js
@@ -296,7 +296,7 @@ const PolariAccount = GObject.registerClass({
params['use-ssl'] = !!params['use-ssl'];
let defaultPort = params['use-ssl'] ? 6697 : 6667;
- params['port'] = params['port'] || defaultPort;
+ params['port'] ||= defaultPort;
return params;
}
diff --git a/src/chatView.js b/src/chatView.js
index f6f7c5ea..4c19ad29 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -158,7 +158,7 @@ const TextView = GObject.registerClass({
}, this.get_pixels_below_lines());
let lineSpace = Math.floor((pixelsAbove + pixelsBelow) / 2);
- y = y - lineSpace + 0.5;
+ y -= lineSpace - 0.5;
let width = this.get_allocated_width() - 2 * MARGIN;
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 8f4215c4..f2748c46 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -490,7 +490,7 @@ class TelepathyClient extends Tp.BaseClient {
});
let reason = Tp.ChannelGroupChangeReason.NONE;
- message = message || _('Good Bye');
+ message ||= _('Good Bye');
try {
await room.channel.leave_async(reason, message);
} catch (e) {