Jump to content

Is that good code?


Recommended Posts

Man, just when I think I know something about anything. So an array isn't copied, even if it's not passed ByRef, unless it's manipulated inside a function?

This works anywhere, not for function parameters only IIRC.

Global $a1[10000]
Global $a2 = $a1

$a2 will 'point' to $a1 until you attempt to modify any of them. Only then a copy (followed by the modification) will take place.

Link to comment
Share on other sites

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Kind of anyway :( You'll find that AutoIt uses copy-on-write optimization for arrays, so that unless the array is modified in the the function, the array never actually gets copied.

Oh, cool. Well, for certain values of "cool"; it isn't called "Mad COW" in C++ circles for nothing. Another reason why AutoIt isn't going to be multi-threaded any time soon, I guess.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...