Bug 237998 - [WebGPU] Mark unchanging class members as const
Summary: [WebGPU] Mark unchanging class members as const
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-16 21:05 PDT by Myles C. Maxfield
Modified: 2022-03-17 00:18 PDT (History)
4 users (show)

See Also:


Attachments
Patch (12.24 KB, patch)
2022-03-16 21:07 PDT, Myles C. Maxfield
kkinnunen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2022-03-16 21:05:12 PDT
[WebGPU] Mark unchanging class members as const
Comment 1 Myles C. Maxfield 2022-03-16 21:07:21 PDT
Created attachment 454931 [details]
Patch
Comment 2 Kimmo Kinnunen 2022-03-17 00:10:42 PDT
Comment on attachment 454931 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454931&action=review

> Source/WebGPU/WebGPU/Adapter.h:58
> +    const id<MTLDevice> m_device { nil };

const members don't need initialisers, as the compiler checks that all the constructors initialise the member
Comment 3 Myles C. Maxfield 2022-03-17 00:13:07 PDT
Comment on attachment 454931 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454931&action=review

>> Source/WebGPU/WebGPU/Adapter.h:58
>> +    const id<MTLDevice> m_device { nil };
> 
> const members don't need initialisers, as the compiler checks that all the constructors initialise the member

I'd like to keep them because of this: https://bugs.webkit.org/show_bug.cgi?id=237437#c2
Comment 4 Myles C. Maxfield 2022-03-17 00:18:02 PDT
Committed r291389 (248519@trunk): <https://commits.webkit.org/248519@trunk>
Comment 5 Radar WebKit Bug Importer 2022-03-17 00:18:17 PDT
<rdar://problem/90415004>