Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/java/org/mtransit/commons/FeatureFlags.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.mtransit.commons

@Suppress("unused", "SimplifyBooleanWithConstants")
@Suppress("unused", "KotlinConstantConditions", "SimplifyBooleanWithConstants")
object FeatureFlags {
// @formatter:off

Expand Down Expand Up @@ -62,5 +62,8 @@ object FeatureFlags {

// endregion Schedule

// const val F_USE_TRIP_IS_FOR_SERVICE_UPDATES = false
const val F_USE_TRIP_IS_FOR_SERVICE_UPDATES = true // WIP

// @formatter:on
}
13 changes: 7 additions & 6 deletions src/main/java/org/mtransit/commons/sql/SQLUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ object SQLUtils {
}

@JvmStatic
fun getWhereGroup(andOr: String, vararg whereClauses: String): String {
val sb = StringBuilder(P1)
fun getWhereGroup(andOr: String, vararg whereClauses: String) = buildString {
for (whereClause in whereClauses) {
if (sb.isNotEmpty()) {
sb.append(andOr)
if (isEmpty()) {
append(P1)
} else {
append(andOr)
}
sb.append(whereClause)
append(whereClause)
}
return sb.append(P2).toString()
if (isNotEmpty()) append(P2)
}

@JvmStatic
Expand Down