DirectoryInfo di = Directory.CreateDirectory(destinationDirectoryName);
string destinationDirectoryFullPath = di.FullName;
if (!destinationDirectoryFullPath.EndsWith(Path.DirectorySeparatorChar))
- destinationDirectoryFullPath += Path.DirectorySeparatorChar;
+ {
+ char sep = Path.DirectorySeparatorChar;
+ destinationDirectoryFullPath = string.Concat(destinationDirectoryFullPath, new ReadOnlySpan<char>(in sep));
+ }
string fileDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectoryFullPath, ArchivingUtils.SanitizeEntryFilePath(source.FullName)));
return hasSeparator ?
directory + name :
- directory + Path.DirectorySeparatorChar + name;
+ directory + PathInternal.DirectorySeparatorCharAsString + name;
}
/// <devdoc>
hash = IdentityHelper.GetNormalizedStrongNameHash(assemblyName)!;
if (hash != null)
{
- hash = "StrongName" + separator + hash;
+ hash = string.Concat("StrongName", new ReadOnlySpan<char>(in separator), hash);
identity = assemblyName;
return;
}
if (string.IsNullOrEmpty(location))
throw new IsolatedStorageException(SR.IsolatedStorage_Init);
Uri locationUri = new Uri(location);
- hash = "Url" + separator + IdentityHelper.GetNormalizedUriHash(locationUri);
+ hash = string.Concat("Url", new ReadOnlySpan<char>(in separator), IdentityHelper.GetNormalizedUriHash(locationUri));
identity = locationUri;
}
{
runtimeDirectory = AppDomain.CurrentDomain.BaseDirectory;
}
- return Path.GetDirectoryName(runtimeDirectory) + Path.DirectorySeparatorChar;
+
+ char sep = Path.DirectorySeparatorChar;
+ return string.Concat(Path.GetDirectoryName(runtimeDirectory), new ReadOnlySpan<char>(in sep));
}
[Obsolete(Obsoletions.RuntimeEnvironmentMessage, DiagnosticId = Obsoletions.RuntimeEnvironmentDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]