Skip to content

Commit

Permalink
cgen: remove condition no longer needed after #15944
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-conigliaro committed Oct 6, 2022
1 parent 3eff20c commit 87a364f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vlib/v/gen/c/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -1097,9 +1097,8 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
}
}
is_node_name_in_first_last_repeat := node.name in ['first', 'last', 'repeat']
if node.receiver_type.is_ptr() && (!left_type.is_ptr() || left_type.has_flag(.variadic)
|| node.from_embed_types.len != 0
|| (left_type.has_flag(.shared_f) && node.name != 'str')) {
if node.receiver_type.is_ptr() && (!left_type.is_ptr()
|| node.from_embed_types.len != 0 || (left_type.has_flag(.shared_f) && node.name != 'str')) {
// The receiver is a reference, but the caller provided a value
// Add `&` automatically.
// TODO same logic in call_args()
Expand Down

0 comments on commit 87a364f

Please sign in to comment.