Tighter newSeqNoInit
This commit is contained in:
parent
b160fdf45c
commit
df131df53f
1 changed files with 1 additions and 4 deletions
|
@ -20,10 +20,7 @@ proc newSeqNoInit*[T](len: Natural): seq[T] =
|
||||||
when defined(nimSeqsV2):
|
when defined(nimSeqsV2):
|
||||||
cast[ptr int](addr result)[] = len
|
cast[ptr int](addr result)[] = len
|
||||||
else:
|
else:
|
||||||
type GenericSeq = ref object
|
cast[ref int](result) = len
|
||||||
len, reserved: int
|
|
||||||
var s = cast[GenericSeq](result)
|
|
||||||
s.len = len
|
|
||||||
|
|
||||||
proc newImageNoInit*(width, height: int): Image =
|
proc newImageNoInit*(width, height: int): Image =
|
||||||
## Creates a new image with appropriate dimensions.
|
## Creates a new image with appropriate dimensions.
|
||||||
|
|
Loading…
Reference in a new issue