forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb14b1eb
committed
Teach convert() and friends to avoid copying when possible.
Presently, pg_convert() allocates a new bytea and copies the resultregardless of whether any conversion actually happened. Thiscommit adjusts this function to return the source pointer as-is ifno conversion occurred. This optimization isn't expected to make atremendous difference, but it still seems worthwhile to avoidunnecessary memory allocations.Author: Yurii RashkovskiiReviewed-by: Bertrand DrouvotDiscussion:https://postgr.es/m/CA%2BRLCQyknBPSWXRBQGOi6aYEcdQ9RpH9Kch4GjoeY8dQ3D%2Bvhw%40mail.gmail.com1 parente7c6efe commitb14b1eb
1 file changed
+6
-6
lines changedLines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
585 | 585 |
| |
586 | 586 |
| |
587 | 587 |
| |
588 |
| - | |
589 |
| - | |
590 |
| - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
591 | 592 |
| |
592 | 593 |
| |
593 | 594 |
| |
594 | 595 |
| |
| 596 | + | |
595 | 597 |
| |
596 | 598 |
| |
597 | 599 |
| |
598 |
| - | |
599 |
| - | |
600 |
| - | |
| 600 | + | |
601 | 601 |
| |
602 | 602 |
| |
603 | 603 |
| |
|
0 commit comments
Comments
(0)