Skip to content

Commit 57262a5

Browse files
authored
Use string.Concat instead of string.Join("" (#667)
1 parent 47b5d81 commit 57262a5

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/Custom/Responses/Items/Reasoning/ReasoningResponseItem.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public ReasoningResponseItem(string summaryText) : this(summaryParts: [new Reaso
1919
// CUSTOM: Added for convenience.
2020
public string GetSummaryText()
2121
{
22-
return string.Join(
23-
separator: string.Empty,
22+
return string.Concat(
2423
values: SummaryParts.Select(part => (part as ReasoningSummaryTextPart)?.Text ?? string.Empty));
2524
}
2625
}

src/Custom/Responses/OpenAIResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ public string GetOutputText()
6767
.Select(item => item as MessageResponseItem)
6868
.SelectMany(message => message.Content.Where(contentPart => contentPart.Kind == ResponseContentPartKind.OutputText)
6969
.Select(outputTextPart => outputTextPart.Text));
70-
return outputTextSegments.Any() ? string.Join(string.Empty, outputTextSegments) : null;
70+
return outputTextSegments.Any() ? string.Concat(outputTextSegments) : null;
7171
}
7272
}

tests/Responses/ResponsesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public async Task StreamingResponses()
252252
}
253253
Assert.That(deltaTextSegments, Has.Count.GreaterThan(0));
254254
Assert.That(finalResponseText, Is.Not.Null.And.Not.Empty);
255-
Assert.That(string.Join(string.Empty, deltaTextSegments), Is.EqualTo(finalResponseText));
255+
Assert.That(string.Concat(deltaTextSegments), Is.EqualTo(finalResponseText));
256256
}
257257

258258
[Test]

0 commit comments

Comments
 (0)