On Thu, 23 Jan 2025 05:49:47 GMT, Julian Waters <jwat...@openjdk.org> wrote:

>> src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp line 
>> 561:
>> 
>>> 559:         tvis.item = tvi;
>>> 560: 
>>> 561:         /* HTREEITEM treeNodeItem = */ TreeView_InsertItem(treeWnd, 
>>> &tvis);
>> 
>> Since it's unused, I'd rather remove the variable altogether.
>> 
>> Does the handle have any other usage except for checking whether an error 
>> occurred?
>
> I'm not sure which handle you're referring to, you mean treeNodeItem? It 
> doesn't seem to be used for checking if an error occurred

Yes, `treeNodeItem` has a type of `HTREEITEM` which is an opaque pointer or a 
handle.

No error checking is performed here, I'm for removing the declaration 
completely.  
I don't see much value in keeping the variable even for debugging purposes… if 
needed, it can be quickly added, or the value of `rax` can be viewed after the 
function call if the debugger doesn't show explicitly the result of the most 
recent function call.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21656#discussion_r1929208016

Reply via email to