@@ -37,8 +37,8 @@ public static class Utility
37
37
{
38
38
// Prefix that uniquely identifies our assemblies
39
39
// i.e.: "f-<functionname>"
40
- public const string AssemblyPrefix = "f-" ;
41
- public const string AssemblySeparator = "__" ;
40
+ private const string AssemblyPrefix = "f-" ;
41
+ private const string AssemblySeparator = "__" ;
42
42
private const string BlobServiceDomain = "blob" ;
43
43
private const string SasVersionQueryParam = "sv" ;
44
44
@@ -153,7 +153,7 @@ internal static async Task InvokeWithRetriesAsync(Func<Task> action, int maxRetr
153
153
/// </summary>
154
154
/// <param name="timeoutSeconds">The maximum number of seconds to delay.</param>
155
155
/// <param name="pollingIntervalMilliseconds">The polling interval.</param>
156
- /// <param name="condition">The condition to check</param>
156
+ /// <param name="condition">The condition to check. </param>
157
157
/// <returns>A Task representing the delay.</returns>
158
158
internal static Task < bool > DelayAsync ( int timeoutSeconds , int pollingIntervalMilliseconds , Func < bool > condition )
159
159
{
@@ -166,7 +166,7 @@ internal static Task<bool> DelayAsync(int timeoutSeconds, int pollingIntervalMil
166
166
/// </summary>
167
167
/// <param name="timeoutSeconds">The maximum number of seconds to delay.</param>
168
168
/// <param name="pollingIntervalMilliseconds">The polling interval.</param>
169
- /// <param name="condition">The async condition to check</param>
169
+ /// <param name="condition">The async condition to check. </param>
170
170
/// <returns>A Task representing the delay.</returns>
171
171
internal static Task < bool > DelayAsync ( int timeoutSeconds , int pollingIntervalMilliseconds , Func < Task < bool > > condition , CancellationToken cancellationToken )
172
172
{
@@ -279,7 +279,7 @@ public static bool IsValidUserType(Type type)
279
279
280
280
public static IReadOnlyDictionary < string , string > ToStringValues ( this IReadOnlyDictionary < string , object > data )
281
281
{
282
- return data . ToDictionary ( p => p . Key , p => p . Value != null ? p . Value . ToString ( ) : null , StringComparer . OrdinalIgnoreCase ) ;
282
+ return data . ToDictionary ( p => p . Key , p => p . Value ? . ToString ( ) , StringComparer . OrdinalIgnoreCase ) ;
283
283
}
284
284
285
285
public static string GetValueOrNull ( this StringDictionary dictionary , string key )
@@ -365,7 +365,7 @@ public static string FlattenException(Exception ex, Func<string, string> sourceF
365
365
366
366
/// <summary>
367
367
/// Applies any additional binding data from the input value to the specified binding data.
368
- /// This binding data then becomes available to the binding process (in the case of late bound bindings)
368
+ /// This binding data then becomes available to the binding process (in the case of late bound bindings).
369
369
/// </summary>
370
370
internal static void ApplyBindingData ( object value , Dictionary < string , object > bindingData )
371
371
{
@@ -441,9 +441,9 @@ public static string ToLowerFirstCharacter(string input)
441
441
}
442
442
443
443
/// <summary>
444
- /// Checks if a given string has a UTF8 BOM
444
+ /// Checks if a given string has a UTF8 BOM.
445
445
/// </summary>
446
- /// <param name="input">The string to be evalutated </param>
446
+ /// <param name="input">The string to be evaluated. </param>
447
447
/// <returns>True if the string begins with a UTF8 BOM; Otherwise, false.</returns>
448
448
public static bool HasUtf8ByteOrderMark ( string input )
449
449
=> input != null && CultureInfo . InvariantCulture . CompareInfo . IsPrefix ( input , UTF8ByteOrderMark , CompareOptions . Ordinal ) ;
@@ -649,11 +649,9 @@ internal static bool IsSingleLanguage(IEnumerable<FunctionMetadata> functions, s
649
649
650
650
internal static string GetWorkerRuntime ( IEnumerable < FunctionMetadata > functions , IEnvironment environment = null )
651
651
{
652
- string workerRuntime = null ;
653
-
654
652
if ( environment != null )
655
653
{
656
- workerRuntime = environment . GetEnvironmentVariable ( EnvironmentSettingNames . FunctionWorkerRuntime ) ;
654
+ var workerRuntime = environment . GetEnvironmentVariable ( EnvironmentSettingNames . FunctionWorkerRuntime ) ;
657
655
658
656
if ( ! string . IsNullOrEmpty ( workerRuntime ) )
659
657
{
@@ -746,7 +744,7 @@ internal static IEnumerable<FunctionMetadata> GetValidFunctions(IEnumerable<Func
746
744
// No valid functions
747
745
return null ;
748
746
}
749
- return indexedFunctions . Where ( m => functionDescriptors . Select ( fd => fd . Metadata . Name ) . Contains ( m . Name ) == true ) ;
747
+ return indexedFunctions . Where ( m => functionDescriptors . Select ( fd => fd . Metadata . Name ) . Contains ( m . Name ) ) ;
750
748
}
751
749
752
750
public static bool CheckAppOffline ( string scriptPath )
@@ -857,10 +855,10 @@ public static bool IsHttporManualTrigger(string triggerType)
857
855
}
858
856
859
857
/// <summary>
860
- /// Computes a stable non-cryptographic hash
858
+ /// Computes a stable non-cryptographic hash.
861
859
/// </summary>
862
- /// <param name="value">The string to use for computation</param>
863
- /// <returns>A stable, non-cryptographic, hash</returns>
860
+ /// <param name="value">The string to use for computation. </param>
861
+ /// <returns>A stable, non-cryptographic, hash. </returns>
864
862
internal static int GetStableHash ( string value )
865
863
{
866
864
if ( value == null )
@@ -933,7 +931,7 @@ public static bool CanWorkerIndex(IEnumerable<RpcWorkerConfig> workerConfigs, IE
933
931
&& ! environment . IsMultiLanguageRuntimeEnvironment ( ) )
934
932
{
935
933
var workerRuntime = environment . GetEnvironmentVariable ( EnvironmentSettingNames . FunctionWorkerRuntime ) ;
936
- var workerConfig = workerConfigs . Where ( c => c . Description != null && c . Description . Language != null && c . Description . Language . Equals ( workerRuntime , StringComparison . InvariantCultureIgnoreCase ) ) . FirstOrDefault ( ) ;
934
+ var workerConfig = workerConfigs . FirstOrDefault ( c => c . Description ? . Language != null && c . Description . Language . Equals ( workerRuntime , StringComparison . InvariantCultureIgnoreCase ) ) ;
937
935
938
936
// if feature flag is enabled and workerConfig.WorkerIndexing == true, then return true
939
937
if ( workerConfig != null
0 commit comments