remove more global variables in the Nim compiler
This commit is contained in:
parent
12bd1c494c
commit
669a564492
77 changed files with 679 additions and 679 deletions
|
|
@ -56,7 +56,7 @@
|
|||
# To cache them they are inserted in a `cache` array.
|
||||
|
||||
import
|
||||
platform, hashes
|
||||
hashes
|
||||
|
||||
type
|
||||
FormatStr* = string # later we may change it to CString for better
|
||||
|
|
@ -70,8 +70,6 @@ type
|
|||
length*: int
|
||||
data*: string # != nil if a leaf
|
||||
|
||||
RopeSeq* = seq[Rope]
|
||||
|
||||
proc len*(a: Rope): int =
|
||||
## the rope's length
|
||||
if a == nil: result = 0
|
||||
|
|
@ -93,7 +91,7 @@ proc freezeMutableRope*(r: Rope) {.inline.} =
|
|||
r.length = r.data.len
|
||||
|
||||
var
|
||||
cache: array[0..2048*2 - 1, Rope]
|
||||
cache: array[0..2048*2 - 1, Rope] # XXX Global here!
|
||||
|
||||
proc resetRopeCache* =
|
||||
for i in low(cache)..high(cache):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue