Make sure Inflections.default is lazily loaded, even in optimized release builds

This commit addresses #755
This commit is contained in:
Gwendal Roué committed 2020-04-13 11:31:03 +02:00
1 parent ed15498871
commit c62ccf1de7
1 file changed
+6
+6
View File
@@ -9,14 +9,20 @@ extension String {
return String(first).uppercased() + dropFirst()
}
// Never inline this property, in order to make sure Inflections.default
// is lazily loaded. See https://github.com/groue/GRDB.swift/issues/755#issuecomment-612418053
/// "player" -> "players"
/// "players" -> "players"
@inline(never)
var pluralized: String {
return Inflections.default.pluralize(self)
}
// Never inline this property, in order to make sure Inflections.default
// is lazily loaded. See https://github.com/groue/GRDB.swift/issues/755#issuecomment-612418053
/// "player" -> "player"
/// "players" -> "player"
@inline(never)
var singularized: String {
return Inflections.default.singularize(self)
}