When passing objects as parameters, are they passed by reference?

后端 未结 5 599
名媛妹妹
名媛妹妹 2021-01-12 12:01

Is there any performance implications if I do either of these:

def do_something(user, article)
...
end

versus

def do_someth         


        
5条回答
  •  天命终不由人
    2021-01-12 12:32

    For example, I would go with the _id variant. I prefer to always be able to get the correct state of my objects. It's never fun to work with stale ones.

提交回复
热议问题