how cna i improve this? I think this is ugly: ``` ...
# codereview
h
how cna i improve this? I think this is ugly:
Copy code
fun getPeriods(
        expression: String? = null,
        day: DayOfWeek? = null,
        date: Date? = null,
        block: Block? = null,
        studentID: Int? = null,
        studentName: String? = null
    ): List<Period> = getPeriods().filter { period ->
        (if (expression != null) period.expression == expression else true) &&
            (if (day != null) period.day == day else true) &&
            (if (date != null) period.date == date else true) &&
            (if (block != null) period.block == block else true) &&
            (if (studentID != null) period.studentID == studentID else true) &&
            (if (studentName != null) period.studentName == studentName else true)
    }
but i wanna give customisability to allow users to filter by anything they wish