Skip to content

Commit

Permalink
Only create a new array when advertised row count is below actual row… (
Browse files Browse the repository at this point in the history
#30)

* Only create a new array when advertised row count is below actual row count

* Remove additional if check
  • Loading branch information
campersau committed May 14, 2021
1 parent 95d1c3d commit 92e64e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SapNwRfc/Internal/Fields/TableField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ public static TableField<T> Extract<T>(RfcInterop interop, IntPtr dataHandle, st
errorInfo: out errorInfo);

if (resultCode == RfcResultCode.RFC_TABLE_MOVE_EOF)
return new TableField<T>(name, rows.Take(i + 1).ToArray());
{
Array.Resize(ref rows, i + 1);
break;
}

resultCode.ThrowOnError(errorInfo);
}
Expand Down

0 comments on commit 92e64e9

Please sign in to comment.