Skip to content

Commit

Permalink
Make sure Inflections.default is lazily loaded, even in optimized rel…
Browse files Browse the repository at this point in the history
…ease builds

This commit addresses #755
  • Loading branch information
groue committed Apr 13, 2020
1 parent ed15498 commit c62ccf1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions GRDB/Utils/Inflections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit c62ccf1

Please sign in to comment.