- Notifications
You must be signed in to change notification settings - Fork5
Commit0cd836a
committed
Measure string lengths only once
Bernd Helmle complained that CreateReplicationSlot() was assigning thesame value to the same variable twice, so we could remove one of them.Code inspection reveals that we can actually remove both assignments:according to the author the assignment was there for beauty of thestrlen line only, and another possible fix to that is to put the strlenin its own line, so do that.To be consistent within the file, refactor all duplicated strlen()calls, which is what we do elsewhere in the backend anyway. Inbasebackup.c, snprintf already returns the right length; no need forstrlen afterwards.Backpatch to 9.4, where replication slots were introduced, to keep codeidentical. Some of this is older, but the patch doesn't apply cleanlyand it's only of cosmetic value anyway.Discussion:http://www.postgresql.org/message-id/BE2FD71DEA35A2287EA5F018@eje.credativ.lan1 parenta1480ec commit0cd836a
2 files changed
+70
-45
lines changedLines changed: 19 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
698 | 698 |
| |
699 | 699 |
| |
700 | 700 |
| |
701 |
| - | |
702 |
| - | |
703 |
| - | |
704 |
| - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
705 | 710 |
| |
706 | 711 |
| |
707 | 712 |
| |
| |||
724 | 729 |
| |
725 | 730 |
| |
726 | 731 |
| |
| 732 | + | |
727 | 733 |
| |
728 | 734 |
| |
729 | 735 |
| |
| |||
742 | 748 |
| |
743 | 749 |
| |
744 | 750 |
| |
745 |
| - | |
| 751 | + | |
746 | 752 |
| |
747 | 753 |
| |
748 | 754 |
| |
| |||
755 | 761 |
| |
756 | 762 |
| |
757 | 763 |
| |
758 |
| - | |
759 |
| - | |
760 |
| - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
761 | 772 |
| |
762 |
| - | |
763 |
| - | |
764 |
| - | |
765 | 773 |
| |
766 | 774 |
| |
767 | 775 |
| |
|
Lines changed: 51 additions & 34 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
299 | 299 |
| |
300 | 300 |
| |
301 | 301 |
| |
| 302 | + | |
302 | 303 |
| |
303 | 304 |
| |
304 | 305 |
| |
| |||
380 | 381 |
| |
381 | 382 |
| |
382 | 383 |
| |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 |
| - | |
389 |
| - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
390 | 401 |
| |
391 | 402 |
| |
392 |
| - | |
393 |
| - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
394 | 406 |
| |
395 | 407 |
| |
396 | 408 |
| |
397 |
| - | |
| 409 | + | |
398 | 410 |
| |
399 | 411 |
| |
400 | 412 |
| |
| |||
413 | 425 |
| |
414 | 426 |
| |
415 | 427 |
| |
| 428 | + | |
416 | 429 |
| |
417 | 430 |
| |
418 | 431 |
| |
| |||
448 | 461 |
| |
449 | 462 |
| |
450 | 463 |
| |
451 |
| - | |
452 |
| - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
453 | 467 |
| |
454 | 468 |
| |
455 | 469 |
| |
| |||
674 | 688 |
| |
675 | 689 |
| |
676 | 690 |
| |
| 691 | + | |
677 | 692 |
| |
678 | 693 |
| |
679 | 694 |
| |
| |||
710 | 725 |
| |
711 | 726 |
| |
712 | 727 |
| |
713 |
| - | |
714 |
| - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
715 | 731 |
| |
716 |
| - | |
717 |
| - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
718 | 735 |
| |
719 | 736 |
| |
720 | 737 |
| |
| |||
762 | 779 |
| |
763 | 780 |
| |
764 | 781 |
| |
765 |
| - | |
766 | 782 |
| |
767 | 783 |
| |
768 | 784 |
| |
| 785 | + | |
769 | 786 |
| |
770 | 787 |
| |
771 | 788 |
| |
| |||
791 | 808 |
| |
792 | 809 |
| |
793 | 810 |
| |
794 |
| - | |
795 |
| - | |
796 | 811 |
| |
797 | 812 |
| |
798 | 813 |
| |
799 | 814 |
| |
800 |
| - | |
801 |
| - | |
| 815 | + | |
802 | 816 |
| |
803 | 817 |
| |
804 | 818 |
| |
| |||
834 | 848 |
| |
835 | 849 |
| |
836 | 850 |
| |
837 |
| - | |
838 | 851 |
| |
839 | 852 |
| |
840 | 853 |
| |
| |||
885 | 898 |
| |
886 | 899 |
| |
887 | 900 |
| |
888 |
| - | |
889 |
| - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
890 | 904 |
| |
891 | 905 |
| |
892 |
| - | |
893 |
| - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
894 | 909 |
| |
895 |
| - | |
| 910 | + | |
896 | 911 |
| |
897 | 912 |
| |
898 |
| - | |
899 |
| - | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
900 | 916 |
| |
901 | 917 |
| |
902 |
| - | |
| 918 | + | |
903 | 919 |
| |
904 |
| - | |
| 920 | + | |
905 | 921 |
| |
906 | 922 |
| |
907 |
| - | |
908 |
| - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
909 | 926 |
| |
910 | 927 |
| |
911 |
| - | |
| 928 | + | |
912 | 929 |
| |
913 | 930 |
| |
914 | 931 |
| |
|
0 commit comments
Comments
(0)