Skip to content

Commit

Permalink
systemd: remove useless spread and list
Browse files Browse the repository at this point in the history
Array.prototype.push supports giving it multiple arguments so making it
a list of and de-structuring is unrequired.
  • Loading branch information
jelly committed Apr 9, 2024
1 parent df41e3f commit 68460ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/systemd/logsHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export const getGrepFiltersFromOptions = ({ options }) => {
options.service.split(",").forEach(s => {
if (!s.endsWith(".service"))
s = s + ".service";
match.push(...['_SYSTEMD_UNIT=' + s, "+", "COREDUMP_UNIT=" + s, "+", "UNIT=" + s]);
match.push('_SYSTEMD_UNIT=' + s, "+", "COREDUMP_UNIT=" + s, "+", "UNIT=" + s);
});
full_grep += "service:" + options.service + " ";
} else if (options["user-service"]) {
options["user-service"].split(",").forEach(s => {
if (!s.endsWith(".service"))
s = s + ".service";
match.push(...['_SYSTEMD_USER_UNIT=' + s, "+", "COREDUMP_USER_UNIT=" + s, "+", "USER_UNIT=" + s]);
match.push('_SYSTEMD_USER_UNIT=' + s, "+", "COREDUMP_USER_UNIT=" + s, "+", "USER_UNIT=" + s);
});
full_grep += "user-service:" + options["user-service"] + " ";
}
Expand Down

0 comments on commit 68460ff

Please sign in to comment.