diff options
author | Peter Eisentraut | 2024-09-11 13:15:49 +0000 |
---|---|---|
committer | Peter Eisentraut | 2024-09-11 13:21:36 +0000 |
commit | 8b5c6a54c4396bb9daeb9ec5d9cbb0d3deedcbe3 (patch) | |
tree | 437b1aaa5d0ee2b9c7a5aae05657a0acfcbaa0cb /src/backend/access/spgist | |
parent | 842265631dfd9e5583d934e2ae328b09bc4b2f8b (diff) |
Replace gratuitous memmove() with memcpy()
The index access methods all had similar code that copied the
passed-in scan keys to local storage. They all used memmove() for
that, which is not wrong, but it seems confusing not to use memcpy()
when that would work. Presumably, this was all once copied from
ancient code and never adjusted.
Discussion: https://www.postgresql.org/message-id/flat/f8c739d9-f48d-4187-b214-df3391ba41ab@eisentraut.org
Diffstat (limited to 'src/backend/access/spgist')
-rw-r--r-- | src/backend/access/spgist/spgscan.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c index 03293a7816e..3017861859f 100644 --- a/src/backend/access/spgist/spgscan.c +++ b/src/backend/access/spgist/spgscan.c @@ -384,16 +384,14 @@ spgrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, /* copy scankeys into local storage */ if (scankey && scan->numberOfKeys > 0) - memmove(scan->keyData, scankey, - scan->numberOfKeys * sizeof(ScanKeyData)); + memcpy(scan->keyData, scankey, scan->numberOfKeys * sizeof(ScanKeyData)); /* initialize order-by data if needed */ if (orderbys && scan->numberOfOrderBys > 0) { int i; - memmove(scan->orderByData, orderbys, - scan->numberOfOrderBys * sizeof(ScanKeyData)); + memcpy(scan->orderByData, orderbys, scan->numberOfOrderBys * sizeof(ScanKeyData)); for (i = 0; i < scan->numberOfOrderBys; i++) { |