Which wd be faster for the computer?

Hello,

What would be the most performant code between those two?

  1. Using the parameter (self.Part also exists here)
function Table:A(Part, pos)
    Part.Position = pos
end
  1. Using the self table, and not the parameters
function Table:A(pos)
    self.Part.Position = pos
end

Thx for reading

1 Like

It seems unnecessary to pass Part as an argument if the class has a dedicated Part referenced, so I’d go with #2, although this should be Table:A(pos) or Table.A(self, pos), if you’ve used Table.new to instantiate the class.

2 Likes

Alright thx ! And yeah I forgot to put : ^^

1 Like