Commit 7ce5f3f
authored
Revise composite success flag handling (#41)
Most of the composite methods return a boolean result indicating whether
or not all of the child handlers successfully performed the operation.
If any of the children fails, the composite result is false.
We were previously using a mix of coding styles:
1. $success = $success && func()
2. $success &= func()
3. if (!func()) { $success = false; }
(1) works fine but results in more (re)writes to $success than are
needed.
(2) is logically equivalent but promotes the value to an integer, which
results in the composite function returning an integer instead of a
boolean. (#40)
(3) is nice because it leaves the $success flag alone until there's a
reason to change it to a failure.
This change updates all of the code to consistently use (3).1 parent 38e6668 commit 7ce5f3f
1 file changed
+13
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
86 | | - | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
110 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
172 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| |||
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
184 | | - | |
185 | | - | |
| 190 | + | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
0 commit comments