Skip to content

Commit 829d2bc

Browse files
authored
Optimize empty check for BinaryData (#889)
Updated the condition to check if `partitionContent` is empty by using the `IsEmpty` property instead of converting it to a byte array and checking its length. This change improves efficiency and readability.
1 parent a973c41 commit 829d2bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service/Core/Handlers/TextPartitioningHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public TextPartitioningHandler(
120120
string partitionsMimeType = MimeTypes.PlainText;
121121

122122
// Skip empty partitions. Also: partitionContent.ToString() throws an exception if there are no bytes.
123-
if (partitionContent.ToArray().Length == 0) { continue; }
123+
if (partitionContent.IsEmpty) { continue; }
124124

125125
switch (file.MimeType)
126126
{

0 commit comments

Comments
 (0)