Use shorter arrow functions where possible

For arrow functions that are both simple and short, we can avoid using explicit `return` to shorten them even further without hurting readability.

For the `gulp mozcentral` build-target this reduces the overall size of the output by just under 1 kilo-byte (which isn't a lot but still can't hurt).
This commit is contained in:
Jonas Jenwald 2024-01-21 10:13:12 +01:00
parent 6e46304357
commit 9dfe9c552c
22 changed files with 78 additions and 169 deletions

View file

@ -24,9 +24,7 @@ import { MessageHandler } from "../../src/shared/message_handler.js";
describe("message_handler", function () {
// Sleep function to wait for sometime, similar to setTimeout but faster.
function sleep(ticks) {
return Promise.resolve().then(() => {
return ticks && sleep(ticks - 1);
});
return Promise.resolve().then(() => ticks && sleep(ticks - 1));
}
describe("sendWithStream", function () {