From 33ca3fae41485ea1bc02753ad53c17f418080f36 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 27 May 2024 22:54:15 -0400 Subject: [PATCH] Cache Truncator singletons returned from static properties --- src/Humanizer/Truncation/Truncator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Humanizer/Truncation/Truncator.cs b/src/Humanizer/Truncation/Truncator.cs index b92c932d8..a0e822723 100644 --- a/src/Humanizer/Truncation/Truncator.cs +++ b/src/Humanizer/Truncation/Truncator.cs @@ -1,4 +1,4 @@ -namespace Humanizer; +namespace Humanizer; /// /// Gets a ITruncator @@ -8,15 +8,15 @@ public static class Truncator /// /// Fixed length truncator /// - public static ITruncator FixedLength => new FixedLengthTruncator(); + public static ITruncator FixedLength { get; } = new FixedLengthTruncator(); /// /// Fixed number of characters truncator /// - public static ITruncator FixedNumberOfCharacters => new FixedNumberOfCharactersTruncator(); + public static ITruncator FixedNumberOfCharacters { get; } = new FixedNumberOfCharactersTruncator(); /// /// Fixed number of words truncator /// - public static ITruncator FixedNumberOfWords => new FixedNumberOfWordsTruncator(); + public static ITruncator FixedNumberOfWords { get; } = new FixedNumberOfWordsTruncator(); } \ No newline at end of file