follow up #20109; remove shallow seqs/strings for ORC (#20502)

* remove `shallow` seqs/strings for ORC

* add a changelog item

* change url of DelaunayNim
This commit is contained in:
ringabout 2022-10-06 13:16:50 +08:00 • committed by GitHub
commit 723a71bd22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 45 deletions

View file

@ -778,20 +778,6 @@ For `let` symbols a copy is not always necessary:
let s = varA # may only copy a pointer if it safe to do so
```
If you know what you're doing, you can also mark single-string (or sequence)
objects as `shallow`:idx:\:
```Nim
var s = "abc"
shallow(s) # mark 's' as a shallow string
var x = s # now might not copy the string!
```
Usage of `shallow` is always safe once you know the string won't be modified
anymore, similar to Ruby's `freeze`:idx:.
The compiler optimizes string case statements: A hashing scheme is used for them
if several different string constants are used. So code like this is reasonably
efficient: