lib/strings,wcc,w6l: collapse nested-if to &&/|| at named sites (Wave-2 structural)
strings.bytesub two endpoint guards, wcc cgdot/cgassign 4-deep allptr/N_IDENT/localfindnode pyramids, and w6l isarchive's 8 sequential magic-byte rejects. The isarchive len<8 read-guard stays a separate statement before the || chain so the byte reads remain bounded. Not byte-id-neutral (short-circuit emits tighter branches / renumbered labels) but functionally identical; cs==ww stage-parity holds. Regenerated all embedding combined.ww.
This commit is contained in:
@@ -2108,15 +2108,11 @@ export fn sub(s: str, start: i32, end: i32) str = {
|
||||
export fn bytesub(s: str, start: i32, end: i32) (str | utf8.invalid) = {
|
||||
os.assert(start <= end, "strings.bytesub: start is higher than end");
|
||||
os.assert(end <= s.len, "strings.bytesub: end exceeds string length");
|
||||
if (start < s.len) {
|
||||
if ((s[start] & 0xC0u8) == 0x80u8) {
|
||||
let e: utf8.invalid; return e;
|
||||
};
|
||||
if (start < s.len && (s[start] & 0xC0u8) == 0x80u8) {
|
||||
let e: utf8.invalid; return e;
|
||||
};
|
||||
if (end < s.len) {
|
||||
if ((s[end] & 0xC0u8) == 0x80u8) {
|
||||
let e: utf8.invalid; return e;
|
||||
};
|
||||
if (end < s.len && (s[end] & 0xC0u8) == 0x80u8) {
|
||||
let e: utf8.invalid; return e;
|
||||
};
|
||||
let r: str;
|
||||
r.ptr = s.ptr + (start: u64);
|
||||
|
||||
Reference in New Issue
Block a user