- Notifications
You must be signed in to change notification settings - Fork28
Commit44ed65a
committed
Avoid use of float arithmetic in bipartite_match.c.
Since the distances used in this algorithm are small integers (not morethan the size of the U set, in fact), there is no good reason to use floatarithmetic for them. Use short ints instead: they're smaller, faster, andrequire no special portability assumptions.Per testing by Greg Stark, which disclosed that the code got into aninfinite loop on VAX for lack of IEEE-style float infinities. We don'treally care all that much whether Postgres can run on a VAX anymore,but there seems sufficient reason to change this code anyway.In passing, make a few other small adjustments to make the code matchusual Postgres coding style a bit better.1 parent5956b7f commit44ed65a
File tree
2 files changed
+55
-36
lines changed- src
- backend/lib
- include/lib
2 files changed
+55
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | | - | |
26 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
41 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | | - | |
46 | 49 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | | - | |
| 63 | + | |
59 | 64 | | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
87 | | - | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | | - | |
| 102 | + | |
93 | 103 | | |
94 | | - | |
| 104 | + | |
95 | 105 | | |
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
102 | | - | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | | - | |
| 124 | + | |
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
118 | | - | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
| 131 | + | |
121 | 132 | | |
122 | | - | |
123 | 133 | | |
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
128 | | - | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
131 | 145 | | |
132 | | - | |
| 146 | + | |
133 | 147 | | |
134 | | - | |
| 148 | + | |
135 | 149 | | |
136 | 150 | | |
137 | 151 | | |
138 | 152 | | |
| 153 | + | |
139 | 154 | | |
140 | 155 | | |
141 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
142 | 160 | | |
143 | | - | |
144 | | - | |
| 161 | + | |
145 | 162 | | |
146 | | - | |
| 163 | + | |
147 | 164 | | |
148 | 165 | | |
149 | 166 | | |
150 | | - | |
| 167 | + | |
151 | 168 | | |
152 | | - | |
| 169 | + | |
153 | 170 | | |
154 | 171 | | |
155 | 172 | | |
| |||
158 | 175 | | |
159 | 176 | | |
160 | 177 | | |
161 | | - | |
| 178 | + | |
162 | 179 | | |
163 | 180 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | | - | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
36 | | - | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
41 | 43 | | |
42 | | - | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
0 commit comments
Comments
(0)