mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
Eliminate if-statement (#3556)
This commit is contained in:
parent
4635f73fee
commit
8d18125cae
@ -61,11 +61,7 @@ export default abstract class Chart<T> {
|
||||
|
||||
constructor(name: string, grouped = false) {
|
||||
this.collection = db.get<Log<T>>(`chart.${name}`);
|
||||
if (grouped) {
|
||||
this.collection.createIndex({ span: -1, date: -1, group: -1 }, { unique: true });
|
||||
} else {
|
||||
this.collection.createIndex({ span: -1, date: -1 }, { unique: true });
|
||||
}
|
||||
this.collection.createIndex({ span: -1, date: -1, group: grouped ? -1 : undefined }, { unique: true });
|
||||
}
|
||||
|
||||
@autobind
|
||||
|
Loading…
Reference in New Issue
Block a user