Skip to content

Commit

Permalink
use suggested natts parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Feb 7, 2024
1 parent 8e70102 commit 88f2e2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pgrx/src/spi/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl<'conn> SpiHeapTupleData<'conn> {
unsafe {
// SAFETY: we know tupdesc is not null
let natts = (*tupdesc).natts;
data.entries.reserve(usize::try_from(natts as usize).unwrap_or_default());
data.entries.reserve(usize::try_from(natts).unwrap());
for i in 1..=natts {
let mut is_null = false;
let datum = pg_sys::SPI_getbinval(htup, tupdesc as _, i, &mut is_null);
Expand Down

0 comments on commit 88f2e2d

Please sign in to comment.