Nim
Nim copied to clipboard
Add envvars.getEnv
- Added
envvars.getEnvoverload that stores the value in argument.
What exactly is the point of this? What's wrong with value = getEnv(...)?
Stores the value in argument, not creating a new string, code is tiny, I do not know how to make the explanation more explicit.
Hm, I'm not sure about this. Isn't the compiler supposed to optimize this (through use of move analysis, etc.)?
the compiler supposed to optimize this
Prove me wrong plz, but it looks like a new string is created on my machine, AFAIK.
Do you actually have a program which calls getenv in a hot code path and so sees significant improvements in performance thanks to this new proc? If so, what are the improvements?