Commit 39c575c
config: simplify parsing of unit factors
Just return the value of the factor or zero for unrecognized strings
instead of using an output reference and a separate return value to
indicate success. This is shorter and simpler.
It basically reverts that function to before c8deb5a ("Improve error
messages when int/long cannot be parsed from config", 2007-12-25), while
keeping the better messages, so restore its old name, get_unit_factor(),
as well.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 664178e commit 39c575c
1 file changed
+12
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
834 | 834 | | |
835 | 835 | | |
836 | 836 | | |
837 | | - | |
| 837 | + | |
838 | 838 | | |
839 | | - | |
840 | | - | |
| 839 | + | |
841 | 840 | | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
855 | 847 | | |
856 | 848 | | |
857 | 849 | | |
| |||
867 | 859 | | |
868 | 860 | | |
869 | 861 | | |
870 | | - | |
| 862 | + | |
| 863 | + | |
871 | 864 | | |
872 | 865 | | |
873 | 866 | | |
| |||
896 | 889 | | |
897 | 890 | | |
898 | 891 | | |
899 | | - | |
| 892 | + | |
| 893 | + | |
900 | 894 | | |
901 | 895 | | |
902 | 896 | | |
| |||
0 commit comments