Skip to content

Commit 2490d97

Browse files
committed
Simplify invocation to Path.Combine
1 parent 4cd5668 commit 2490d97

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/core/IronPython/Runtime/Types/DocBuilder.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,14 @@ private static XPathDocument GetXPathDocument(Assembly asm) {
555555

556556
string baseDir = Path.GetDirectoryName(location);
557557
string baseFile = Path.GetFileNameWithoutExtension(location) + ".xml";
558-
string xml = Path.Combine(Path.Combine(baseDir, ci.Name), baseFile);
558+
string xml = Path.Combine(baseDir, ci.Name, baseFile);
559559

560560
bool isRef = false;
561561

562562
if (!File.Exists(xml)) {
563563
int hyphen = ci.Name.IndexOf('-');
564564
if (hyphen != -1) {
565-
xml = Path.Combine(Path.Combine(baseDir, ci.Name.Substring(0, hyphen)), baseFile);
565+
xml = Path.Combine(baseDir, ci.Name.Substring(0, hyphen), baseFile);
566566
}
567567
if (!File.Exists(xml)) {
568568
xml = Path.Combine(baseDir, baseFile);
@@ -571,10 +571,8 @@ private static XPathDocument GetXPathDocument(Assembly asm) {
571571
// On .NET 4.0 documentation is in the reference assembly location
572572
// for 64-bit processes, we need to look in Program Files (x86)
573573
xml = Path.Combine(
574-
Path.Combine(
575-
Environment.GetFolderPath(Environment.Is64BitProcess ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles),
576-
_frameworkReferencePath
577-
),
574+
Environment.GetFolderPath(Environment.Is64BitProcess ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles),
575+
_frameworkReferencePath,
578576
baseFile
579577
);
580578
isRef = true;

tests/IronPython.Tests/EngineTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public void ScenarioCodePlex20472() {
422422
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
423423
#endif
424424
// This test file is encoded in Windows codepage 1251 (Cyrilic) but lacks a magic comment (PEP-263)
425-
string fileName = Path.Combine(Path.Combine(Common.ScriptTestDirectory, "encoded_files"), "cp20472.py");
425+
string fileName = Path.Combine(Common.ScriptTestDirectory, "encoded_files", "cp20472.py");
426426
try {
427427
_pe.CreateScriptSourceFromFile(fileName).Compile();
428428

0 commit comments

Comments
 (0)