1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: remove condition no longer needed after #15944

This commit is contained in:
Joe Conigliaro 2022-10-06 17:15:15 +11:00
parent 3eff20c5fd
commit 87a364ff24
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1

View File

@ -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()