From c62ccf1de779adbe5ab210d15a4e3fb763c87df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 13 Apr 2020 11:31:03 +0200 Subject: [PATCH] Make sure Inflections.default is lazily loaded, even in optimized release builds This commit addresses #755 --- GRDB/Utils/Inflections.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GRDB/Utils/Inflections.swift b/GRDB/Utils/Inflections.swift index da6c5b176..01051b2d6 100644 --- a/GRDB/Utils/Inflections.swift +++ b/GRDB/Utils/Inflections.swift @@ -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) }