Skip to content

Commit c19f6bd

Browse files
bordingSimonCropp
andauthored
Improvements (#4902)
* avoid array allocations for string split (#4895) * use char override for string.Join (#4896) * use concat instead of join (#4897) * Undo changes to RavenDB indexes --------- Co-authored-by: Simon Cropp <[email protected]>
1 parent 4f96b1c commit c19f6bd

File tree

18 files changed

+21
-23
lines changed

18 files changed

+21
-23
lines changed

src/Particular.LicensingComponent.UnitTests/API/APIApprovals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void HttpApiRoutes()
3939
return new
4040
{
4141
MethodSignature = methodSignature,
42-
HttpMethods = string.Join("/", httpMethods),
42+
HttpMethods = string.Join('/', httpMethods),
4343
Route = route.Template
4444
};
4545
})

src/ServiceControl.AcceptanceTests/TestSupport/SelfVerification/EndpointNameEnforcementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void EndpointName_should_not_exceed_maximum_length()
2121
.Where(t => Conventions.EndpointNamingConvention(t).Length > endpointNameMaxLength)
2222
.ToList();
2323

24-
Assert.That(violators, Is.Empty, string.Join(",", violators));
24+
Assert.That(violators, Is.Empty, string.Join(',', violators));
2525
}
2626

2727
static bool IsEndpointClass(Type t) => endpointConfigurationBuilderType.IsAssignableFrom(t);

src/ServiceControl.Audit.AcceptanceTests/TestSupport/SelfVerification/EndpointNameEnforcementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void EndpointName_should_not_exceed_maximum_length()
2121
.Where(t => Conventions.EndpointNamingConvention(t).Length > endpointNameMaxLength)
2222
.ToList();
2323

24-
Assert.That(violators, Is.Empty, string.Join(",", violators));
24+
Assert.That(violators, Is.Empty, string.Join(',', violators));
2525
}
2626

2727
static bool IsEndpointClass(Type t) => endpointConfigurationBuilderType.IsAssignableFrom(t);

src/ServiceControl.Audit.UnitTests/API/APIApprovals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void HttpApiRoutes()
6464
return new
6565
{
6666
MethodSignature = methodSignature,
67-
HttpMethods = string.Join("/", httpMethods),
67+
HttpMethods = string.Join('/', httpMethods),
6868
Route = route.Template
6969
};
7070
})

src/ServiceControl.Audit/Infrastructure/FullTypeNameOnlyBehavior.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public Task Invoke(IOutgoingPhysicalMessageContext context, Func<IOutgoingPhysic
1616
enclosedTypes[i] = enclosedTypes[i].Replace($", {AssemblyFullName}", string.Empty);
1717
}
1818

19-
context.Headers[Headers.EnclosedMessageTypes] = string.Join(";", enclosedTypes);
19+
context.Headers[Headers.EnclosedMessageTypes] = string.Join(';', enclosedTypes);
2020

2121
return next(context);
2222
}

src/ServiceControl.Config/Validation/Validations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static IRuleBuilderOptions<T, string> MonitoringInstancePortAvailable<T>(
177177
public static IRuleBuilderOptions<T, string> ValidPath<T>(this IRuleBuilder<T, string> rulebuilder)
178178
{
179179
return rulebuilder.Must((t, path) => { return path != null && !path.Intersect(ILLEGAL_PATH_CHARS).Any(); })
180-
.WithMessage(string.Format(MSG_ILLEGAL_PATH_CHAR, string.Join(" ", ILLEGAL_PATH_CHARS)));
180+
.WithMessage(string.Format(MSG_ILLEGAL_PATH_CHAR, string.Join(' ', ILLEGAL_PATH_CHARS)));
181181
}
182182

183183
public static IRuleBuilderOptions<T, TProperty> MustNotBeIn<T, TProperty>(this IRuleBuilder<T, TProperty> ruleBuilder, Func<T, IEnumerable<TProperty>> list) where TProperty : class

src/ServiceControl.Monitoring.AcceptanceTests/ConventionEnforcementTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Ensure_all_tests_derive_from_a_common_base_class()
2020
.Where(t => t.BaseType == null || !typeof(NServiceBusAcceptanceTest).IsAssignableFrom(t))
2121
.ToList();
2222

23-
Assert.That(missingBaseClass, Is.Empty, string.Join(",", missingBaseClass));
23+
Assert.That(missingBaseClass, Is.Empty, string.Join(',', missingBaseClass));
2424
}
2525

2626
[Test]
@@ -33,7 +33,7 @@ public void Ensure_all_sagadatas_are_public()
3333
.Where(t => typeof(IContainSagaData).IsAssignableFrom(t))
3434
.ToList();
3535

36-
Assert.That(sagaDatas, Is.Empty, string.Join(",", sagaDatas));
36+
Assert.That(sagaDatas, Is.Empty, string.Join(',', sagaDatas));
3737
}
3838

3939
static bool HasTestMethod(Type t)

src/ServiceControl.Monitoring.AcceptanceTests/TestSupport/SelfVerification/EndpointNameEnforcementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void EndpointName_should_not_exceed_maximum_length()
2121
.Where(t => Conventions.EndpointNamingConvention(t).Length > endpointNameMaxLength)
2222
.ToList();
2323

24-
Assert.That(violators, Is.Empty, string.Join(",", violators));
24+
Assert.That(violators, Is.Empty, string.Join(',', violators));
2525
}
2626

2727
static bool IsEndpointClass(Type t) => endpointConfigurationBuilderType.IsAssignableFrom(t);

src/ServiceControl.Monitoring.UnitTests/API/APIApprovals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void HttpApiRoutes()
4141
return new
4242
{
4343
MethodSignature = methodSignature,
44-
HttpMethods = string.Join("/", httpMethods),
44+
HttpMethods = string.Join('/', httpMethods),
4545
Route = route.Template
4646
};
4747
})

src/ServiceControl.MultiInstance.AcceptanceTests/TestSupport/SelfVerification/EndpointNameEnforcementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void EndpointName_should_not_exceed_maximum_length()
2121
.Where(t => Conventions.EndpointNamingConvention(t).Length > endpointNameMaxLength)
2222
.ToList();
2323

24-
Assert.That(violators, Is.Empty, string.Join(",", violators));
24+
Assert.That(violators, Is.Empty, string.Join(',', violators));
2525
}
2626

2727
static bool IsEndpointClass(Type t) => endpointConfigurationBuilderType.IsAssignableFrom(t);

0 commit comments

Comments
 (0)