Bug 304113
| Summary: | Reduce boilerplate in Quirks.cpp with QUIRKS_EARLY_RETURN_IF_DISABLED_WITH_VALUE macro | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brandon <brandonstewart> |
| Component: | WebCore Misc. | Assignee: | Brandon <brandonstewart> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Brandon
Introduce QUIRKS_EARLY_RETURN_IF_DISABLED macro to reduce repetitive boilerplate
in Quirks.cpp. This replaces 118 instances of the pattern:
if (!needsQuirks()) [[unlikely]]
return <value>;
with:
QUIRKS_EARLY_RETURN_IF_DISABLED(<value>);
This reduces the file by ~114 lines and improves consistency. The macro accepts
any return value, allowing it to handle the various return types used
(bool, String, std::optional, and StorageAccessResult).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/166445289>
Brandon
Pull request: https://github.com/WebKit/WebKit/pull/55361
EWS
Committed 304509@main (b1538aeb1640): <https://commits.webkit.org/304509@main>
Reviewed commits have been landed. Closing PR #55361 and removing active labels.