Skip to content

Commit 96fc865

Browse files
committed
remove if debug
1 parent 38ae477 commit 96fc865

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

src/Build/Errors/InvalidToolsetDefinitionException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ internal static void Throw(
160160
string resourceName,
161161
params string[] args)
162162
{
163-
#if DEBUG
164163
ResourceUtilities.VerifyResourceStringExists(resourceName);
165-
#endif
166164
string errorCode;
167165
string helpKeyword;
168166
string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(out errorCode, out helpKeyword, resourceName, (object[])args);

src/Shared/ErrorUtilities.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,7 @@ internal static void VerifyThrowInvalidOperation(
335335
bool condition,
336336
string resourceName)
337337
{
338-
#if DEBUG
339338
ResourceUtilities.VerifyResourceStringExists(resourceName);
340-
#endif
341339
if (!condition)
342340
{
343341
// PERF NOTE: explicitly passing null for the arguments array
@@ -357,9 +355,7 @@ internal static void VerifyThrowInvalidOperation(
357355
string resourceName,
358356
object arg0)
359357
{
360-
#if DEBUG
361358
ResourceUtilities.VerifyResourceStringExists(resourceName);
362-
#endif
363359
// PERF NOTE: check the condition here instead of pushing it into
364360
// the ThrowInvalidOperation() method, because that method always
365361
// allocates memory for its variable array of arguments
@@ -382,9 +378,7 @@ internal static void VerifyThrowInvalidOperation(
382378
object arg0,
383379
object arg1)
384380
{
385-
#if DEBUG
386381
ResourceUtilities.VerifyResourceStringExists(resourceName);
387-
#endif
388382
// PERF NOTE: check the condition here instead of pushing it into
389383
// the ThrowInvalidOperation() method, because that method always
390384
// allocates memory for its variable array of arguments
@@ -409,9 +403,7 @@ internal static void VerifyThrowInvalidOperation(
409403
object arg1,
410404
object arg2)
411405
{
412-
#if DEBUG
413406
ResourceUtilities.VerifyResourceStringExists(resourceName);
414-
#endif
415407
// PERF NOTE: check the condition here instead of pushing it into
416408
// the ThrowInvalidOperation() method, because that method always
417409
// allocates memory for its variable array of arguments
@@ -438,9 +430,7 @@ internal static void VerifyThrowInvalidOperation(
438430
object arg2,
439431
object arg3)
440432
{
441-
#if DEBUG
442433
ResourceUtilities.VerifyResourceStringExists(resourceName);
443-
#endif
444434
// PERF NOTE: check the condition here instead of pushing it into
445435
// the ThrowInvalidOperation() method, because that method always
446436
// allocates memory for its variable array of arguments
@@ -579,9 +569,7 @@ internal static void VerifyThrowArgument(
579569
Exception innerException,
580570
string resourceName)
581571
{
582-
#if DEBUG
583572
ResourceUtilities.VerifyResourceStringExists(resourceName);
584-
#endif
585573
if (!condition)
586574
{
587575
// PERF NOTE: explicitly passing null for the arguments array
@@ -604,9 +592,7 @@ internal static void VerifyThrowArgument(
604592
string resourceName,
605593
object arg0)
606594
{
607-
#if DEBUG
608595
ResourceUtilities.VerifyResourceStringExists(resourceName);
609-
#endif
610596
// PERF NOTE: check the condition here instead of pushing it into
611597
// the ThrowArgument() method, because that method always allocates
612598
// memory for its variable array of arguments
@@ -632,9 +618,7 @@ internal static void VerifyThrowArgument(
632618
object arg0,
633619
object arg1)
634620
{
635-
#if DEBUG
636621
ResourceUtilities.VerifyResourceStringExists(resourceName);
637-
#endif
638622
// PERF NOTE: check the condition here instead of pushing it into
639623
// the ThrowArgument() method, because that method always allocates
640624
// memory for its variable array of arguments
@@ -656,9 +640,7 @@ internal static void VerifyThrowArgument(
656640
object arg1,
657641
object arg2)
658642
{
659-
#if DEBUG
660643
ResourceUtilities.VerifyResourceStringExists(resourceName);
661-
#endif
662644
// PERF NOTE: check the condition here instead of pushing it into
663645
// the ThrowArgument() method, because that method always allocates
664646
// memory for its variable array of arguments
@@ -681,9 +663,7 @@ internal static void VerifyThrowArgument(
681663
object arg2,
682664
object arg3)
683665
{
684-
#if DEBUG
685666
ResourceUtilities.VerifyResourceStringExists(resourceName);
686-
#endif
687667
// PERF NOTE: check the condition here instead of pushing it into
688668
// the ThrowArgument() method, because that method always allocates
689669
// memory for its variable array of arguments
@@ -819,9 +799,7 @@ internal static void VerifyThrowArgumentNull(object parameter, string parameterN
819799
/// <remarks>This method is thread-safe.</remarks>
820800
internal static void VerifyThrowArgumentNull(object parameter, string parameterName, string resourceName)
821801
{
822-
#if DEBUG
823802
ResourceUtilities.VerifyResourceStringExists(resourceName);
824-
#endif
825803
if (parameter == null)
826804
{
827805
ThrowArgumentNull(parameterName, resourceName);

src/Shared/ResourceUtilities.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5-
#if !BUILDINGAPPXTASKS && DEBUG
5+
#if !BUILDINGAPPXTASKS
66
using System.Resources;
77
using System.Diagnostics;
88
#endif
@@ -261,9 +261,9 @@ internal static string FormatString(string unformatted, params object[] args)
261261
/// </summary>
262262
/// <remarks>This method is thread-safe.</remarks>
263263
/// <param name="resourceName">Resource string to check.</param>
264+
[Conditional("DEBUG")]
264265
internal static void VerifyResourceStringExists(string resourceName)
265266
{
266-
#if DEBUG
267267
try
268268
{
269269
// Look up the resource string in the engine's string table.
@@ -298,6 +298,5 @@ internal static void VerifyResourceStringExists(string resourceName)
298298
}
299299
#endif
300300
}
301-
#endif
302301
}
303302
}

0 commit comments

Comments
 (0)