You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2020/06/24 18:11:55 UTC

[lucenenet] 01/26: Reformated Debug assert call with String.Format with interpolation call. Improvement of 15%

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit cdf7cf9ece55506fbd07eccf122597fad0e80347
Author: Michael <mi...@hotmail.com>
AuthorDate: Sat Jun 20 12:16:46 2020 +0700

    Reformated Debug assert call with String.Format with interpolation call. Improvement of 15%
---
 .../Support/Randomized/Generators/RandomInts.cs                        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Lucene.Net.TestFramework/Support/Randomized/Generators/RandomInts.cs b/src/Lucene.Net.TestFramework/Support/Randomized/Generators/RandomInts.cs
index fb5e379..91acfb1 100644
--- a/src/Lucene.Net.TestFramework/Support/Randomized/Generators/RandomInts.cs
+++ b/src/Lucene.Net.TestFramework/Support/Randomized/Generators/RandomInts.cs
@@ -32,7 +32,8 @@ namespace Lucene.Net.Randomized.Generators
         /// </summary>
         public static int RandomInt32Between(Random random, int min, int max)
         {
-            Debug.Assert(min <= max, String.Format("Min must be less than or equal max int. min: {0}, max: {1}", min, max));
+            Debug.Assert(min <= max,
+                $"Min must be less than or equal max int. min: {min.ToString()}, max: {max.ToString()}");
             var range = max - min;
             if (range < Int32.MaxValue)
                 return min + random.Next(1 + range);