You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, the code value.Index(j).Set(val) is actively editing the input argument. Could you help me understand why this line exists/does what it does? I'm failing to grasp the logic behind it 😅
Edit: A coffee helped. I understand the algorithm itself, it edits the input argument and a copy is therefore not needed, using j as a secondary index. Though, there is no mention in the comment/function doc (unless I missed it somewhere), that it actually alters the original array! Maybe this issue is more related to this, I was not understanding why the input argument was being altered.
Thanks a lot,
Alberto
The text was updated successfully, but these errors were encountered:
cmaster11
changed the title
Possible clarification needed?
Possible clarification needed for Uniq function?
Jun 18, 2020
Hi! I was browsing through the code, and for the
Uniq
function I noticed this line:go-funk/transform.go
Line 328 in 1d24b29
Now, the code
value.Index(j).Set(val)
is actively editing the input argument. Could you help me understand why this line exists/does what it does? I'm failing to grasp the logic behind it 😅Edit: A coffee helped. I understand the algorithm itself, it edits the input argument and a copy is therefore not needed, using
j
as a secondary index. Though, there is no mention in the comment/function doc (unless I missed it somewhere), that it actually alters the original array! Maybe this issue is more related to this, I was not understanding why the input argument was being altered.Thanks a lot,
Alberto
The text was updated successfully, but these errors were encountered: