Commit de90a05
committed
gv_magicalize: Refactor
This refactors to eliminate redundant code. Some things are magical
only if we are using the main stash; others in any stash; one only in
PL_debstash.
Previously, the switches were structured thusly:
1) if we aren't using the main stash, handle things not requiring the
main stash
2) if we are using the main stash, handle all len > 1 things that can
be in the main stash. This duplicates much of item 1)
3) if we are using the main stash, handle all len == 1 things that can
be in the main stash. This duplicates some of item 1)
The new structure is
if (len > 1) {
1) handle len > 1 things not requiring main stash, regardless of the
stash we are in
2) handle len > 1 things requiring main stash
} else {
3) handle len == 1 things, regardless of the stash we are in.
}
This removes the duplicated code.
The case for 'a' and 'b' are special. When 'a' stands for "args" it is
len > 1 and that is handled in 1).
But 'a' can also mean a single character, as 'b' always does. These
cases are handled in 3). These are the only two len == 1 characters
that don't have to be in the main package, so there is an extra
conditional clause to allow that.1 parent 3ce2956 commit de90a05
1 file changed
+22
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2101 | 2101 | | |
2102 | 2102 | | |
2103 | 2103 | | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
| 2104 | + | |
2108 | 2105 | | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2109 | 2109 | | |
2110 | 2110 | | |
2111 | 2111 | | |
| |||
2129 | 2129 | | |
2130 | 2130 | | |
2131 | 2131 | | |
2132 | | - | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
2136 | 2132 | | |
2137 | 2133 | | |
2138 | 2134 | | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
2139 | 2138 | | |
2140 | 2139 | | |
2141 | | - | |
2142 | | - | |
| 2140 | + | |
2143 | 2141 | | |
2144 | 2142 | | |
2145 | 2143 | | |
| |||
2149 | 2147 | | |
2150 | 2148 | | |
2151 | 2149 | | |
2152 | | - | |
2153 | | - | |
2154 | | - | |
2155 | | - | |
2156 | | - | |
2157 | | - | |
2158 | | - | |
2159 | | - | |
2160 | | - | |
2161 | | - | |
2162 | | - | |
2163 | | - | |
2164 | | - | |
2165 | | - | |
2166 | | - | |
2167 | 2150 | | |
2168 | 2151 | | |
2169 | 2152 | | |
| |||
2195 | 2178 | | |
2196 | 2179 | | |
2197 | 2180 | | |
2198 | | - | |
2199 | | - | |
2200 | | - | |
2201 | | - | |
2202 | 2181 | | |
2203 | 2182 | | |
2204 | 2183 | | |
| |||
2300 | 2279 | | |
2301 | 2280 | | |
2302 | 2281 | | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
2307 | 2293 | | |
2308 | 2294 | | |
2309 | 2295 | | |
| |||
2458 | 2444 | | |
2459 | 2445 | | |
2460 | 2446 | | |
2461 | | - | |
| 2447 | + | |
| 2448 | + | |
2462 | 2449 | | |
2463 | 2450 | | |
2464 | 2451 | | |
| 2452 | + | |
2465 | 2453 | | |
2466 | 2454 | | |
2467 | 2455 | | |
| |||
0 commit comments