Skip to content

Commit

Permalink
[sourcegen] Add clarifying comments for list copy in _convert_func
Browse files Browse the repository at this point in the history
  • Loading branch information
burkenyo authored and speth committed Aug 17, 2022
1 parent 2a426cc commit 080d5fe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions interfaces/sourcegen/sourcegen/csharp/_CSharpSourceGenerator.py
Expand Up @@ -118,11 +118,16 @@ def _get_handle_class_name(self, clib_area: str) -> str:
return self._get_wrapper_class_name(clib_area) + "Handle"

def _convert_func(self, parsed: Func) -> CsFunc:
ret_type, name, params = parsed
ret_type, name, _ = parsed
clib_area, method = name.split("_", 1)

# shallow copy the params list
params = params[:]
# Shallow copy the params list
# Some of the C# params will have the same syntax as the C params.
# Others will be represented differently on the C# side, and we will
# replace their entry in the list.
# Therefore, copy the list so that we don’t accidentally modify
# the params list which is attached to the C func.
params = parsed.params[:]

release_func_handle_class_name = None

Expand Down

0 comments on commit 080d5fe

Please sign in to comment.