js: Convert _.clone(a) to { ...a } or a.slice().

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-08 19:44:12 -08:00
committed by Tim Abbott
parent c9dbd13189
commit 1087fbebfe
5 changed files with 11 additions and 13 deletions

View File

@@ -488,7 +488,7 @@ Filter.prototype = {
filter_with_new_topic: function (new_topic) {
const terms = this._operators.map(term => {
const new_term = _.clone(term);
const new_term = { ...term };
if (new_term.operator === 'topic' && !new_term.negated) {
new_term.operand = new_topic;
}
@@ -626,7 +626,7 @@ Filter.sorted_term_types = function (term_types) {
return util.strcmp(a, b);
}
return _.clone(term_types).sort(compare);
return term_types.slice().sort(compare);
};
Filter.operator_to_prefix = function (operator, negated) {