diff options
author | bptato <nincsnevem662@gmail.com> | 2024-11-28 17:44:40 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-11-28 17:44:40 +0100 |
commit | bd38cbbc7068737214129cc5365ee8d4bfecda9c (patch) | |
tree | da9d6f772eea3e8def9d58c1a5afd568375b2d7a /src/html/script.nim | |
parent | 46abcd79d5422261cc349cc0b4981357d5ae2fcd (diff) | |
download | chawan-bd38cbbc7068737214129cc5365ee8d4bfecda9c.tar.gz |
twtstr: add mypairs
This couldn't get into system.nim for technical reasons, but it's still pretty useful when iterating over non-mutable openArrays.
Diffstat (limited to 'src/html/script.nim')
-rw-r--r-- | src/html/script.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/html/script.nim b/src/html/script.nim index 2e009503..2d77c312 100644 --- a/src/html/script.nim +++ b/src/html/script.nim @@ -2,6 +2,7 @@ import monoucha/javascript import monoucha/quickjs import types/referrer import types/url +import utils/twtstr type ParserMetadata* = enum @@ -84,7 +85,7 @@ var errorImpl*: proc(ctx: JSContext; ss: varargs[string]) {.nimcall.} proc find*(moduleMap: ModuleMap; url: URL; moduleType: string): int = let surl = $url - for i, entry in moduleMap: + for i, entry in moduleMap.mypairs: if entry.key.moduleType == moduleType and entry.key.url == surl: return i return -1 |