Skip to content

Commit d2e0f17

Browse files
committed
Use key_arg instead of call in get_key_ptr
1 parent 4af6c4d commit d2e0f17

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

pythonbpf/helper/helper_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,8 @@ def create_int_constant_ptr(value, builder, int_width=64):
3737
return ptr
3838

3939

40-
def get_key_ptr(call, builder, local_sym_tab):
40+
def get_key_ptr(key_arg, builder, local_sym_tab):
4141
"""Extract key pointer from the call arguments."""
42-
if not call.args or len(call.args) != 1:
43-
raise ValueError("Map lookup expects exactly one argument, got "
44-
f"{len(call.args)}")
45-
46-
key_arg = call.args[0]
4742

4843
if isinstance(key_arg, ast.Name):
4944
key_ptr = get_var_ptr_from_name(key_arg.id, local_sym_tab)

0 commit comments

Comments
 (0)