Merge pull request #3957 from endragor/vmropes
Make ropes usable in VM context
This commit is contained in:
commit
1073f9ec5a
1 changed files with 9 additions and 4 deletions
|
|
@ -134,7 +134,12 @@ proc rope*(s: string): Rope {.rtl, extern: "nro$1Str".} =
|
||||||
## Converts a string to a rope.
|
## Converts a string to a rope.
|
||||||
if s.len == 0:
|
if s.len == 0:
|
||||||
result = nil
|
result = nil
|
||||||
elif cacheEnabled:
|
else:
|
||||||
|
when nimvm:
|
||||||
|
# No caching in VM context
|
||||||
|
result = newRope(s)
|
||||||
|
else:
|
||||||
|
if cacheEnabled:
|
||||||
result = insertInCache(s, cache)
|
result = insertInCache(s, cache)
|
||||||
cache = result
|
cache = result
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue