Nim icon indicating copy to clipboard operation
Nim copied to clipboard

remove `var` for ref parameters in `std/tables`

Open ringabout opened this issue 1 year ago • 1 comments

ref https://github.com/nim-lang/Nim/pull/2139

It seems that it was probably caused by copy pasting.

image

ringabout avatar Aug 07 '22 18:08 ringabout

The PR makes hasKeyOrPut accept immutable refs like mgetOrPut does. It should does less harm in breaking changes' regard. Though it can probably break something if people pass it to function parameters.

No other procs in tables disallow immutable refs.

ringabout avatar Aug 07 '22 18:08 ringabout

Thanks for your hard work on this PR! The lines below are statistics of the Nim compiler built from ea44c5cfed21951feb5978b74fbc6cdb24f54ac2

Hint: mm: orc; threads: on; opt: speed; options: -d:release 163880 lines; 12.366s; 840.68MiB peakmem

github-actions[bot] avatar Aug 25 '22 21:08 github-actions[bot]