diff options
author | bptato <nincsnevem662@gmail.com> | 2023-10-25 12:35:11 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-10-25 12:48:30 +0200 |
commit | 3f0a183d48a44cbbe642842fb60b69cca9e83390 (patch) | |
tree | 0aad7dfeaa3a9265e030b2ed2739de4e042a69a2 /src/css | |
parent | b6e5390ec286747ce6789f9cfec54dec8dc18fa3 (diff) | |
download | chawan-3f0a183d48a44cbbe642842fb60b69cca9e83390.tar.gz |
reduce new() usage
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/sheet.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/css/sheet.nim b/src/css/sheet.nim index 1f68816a..d3cd011f 100644 --- a/src/css/sheet.nim +++ b/src/css/sheet.nim @@ -34,11 +34,12 @@ type SelectorHashes = object class: string func newStylesheet*(cap: int): CSSStylesheet = - new(result) let bucketsize = cap div 2 - result.id_table = initTable[string, seq[CSSRuleDef]](bucketsize) - result.class_table = initTable[string, seq[CSSRuleDef]](bucketsize) - result.general_list = newSeqOfCap[CSSRuleDef](bucketsize) + return CSSStylesheet( + id_table: initTable[string, seq[CSSRuleDef]](bucketsize), + class_table: initTable[string, seq[CSSRuleDef]](bucketsize), + general_list: newSeqOfCap[CSSRuleDef](bucketsize) + ) proc getSelectorIds(hashes: var SelectorHashes, sel: Selector): bool |